summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-07-04 12:07:26 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-07-04 12:07:26 +0400
commit8ce70ed205e01913845330d084b9dd793b66d2c6 (patch)
tree460d38b6d758a660b0fe2c02557f94ce40539496 /configure.in
parent24a212eb232e081c12f6b52429757657f0528e66 (diff)
downloademacs-8ce70ed205e01913845330d084b9dd793b66d2c6.tar.gz
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 'configure.in')
-rw-r--r--configure.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 20b4cf2d593..dde8bcca855 100644
--- a/configure.in
+++ b/configure.in
@@ -681,6 +681,12 @@ else
nw="$nw -Wsuggest-attribute=const"
nw="$nw -Wsuggest-attribute=pure"
+ # Some loops can't be optimized with -O1,
+ # so remove -Wunsafe-loop-optimizations.
+ if echo "$CFLAGS" | $EGREP 'O1' 1>/dev/null; then
+ nw="$nw -Wunsafe-loop-optimizations"
+ fi
+
gl_MANYWARN_ALL_GCC([ws])
gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
for w in $ws; do