diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-07-04 12:07:26 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-07-04 12:07:26 +0400 |
commit | 8ce70ed205e01913845330d084b9dd793b66d2c6 (patch) | |
tree | 460d38b6d758a660b0fe2c02557f94ce40539496 /src/doprnt.c | |
parent | 24a212eb232e081c12f6b52429757657f0528e66 (diff) | |
download | emacs-8ce70ed205e01913845330d084b9dd793b66d2c6.tar.gz emacs-8ce70ed205e01913845330d084b9dd793b66d2c6.tar.bz2 emacs-8ce70ed205e01913845330d084b9dd793b66d2c6.zip |
Fix compilation with --enable-gcc-warnings and -O1
optimization level.
* configure.in: If --enable-gcc-warnings, disable
-Wunsafe-loop-optimizations for -O1 optimization level.
* src/doprnt.c (doprnt): Change type of tem to int, initialize
to avoid compiler warning. Add eassert.
* src/search.c (simple_search): Initialize match_byte to avoid
compiler warning. Add eassert.
Diffstat (limited to 'src/doprnt.c')
-rw-r--r-- | src/doprnt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/doprnt.c b/src/doprnt.c index 07bbcff7081..707dd0648b5 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -150,7 +150,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, /* Buffer we have got with malloc. */ char *big_buffer = NULL; - register size_t tem; + register int tem = -1; char *string; char fixed_buffer[20]; /* Default buffer for small formatting. */ char *fmtcpy; @@ -368,6 +368,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, /* Copy string into final output, truncating if no room. */ doit: + eassert (tem != -1); /* Coming here means STRING contains ASCII only. */ if (STRING_BYTES_BOUND < tem) error ("Format width or precision too large"); |