diff options
Diffstat (limited to 'auto/cc')
-rw-r--r-- | auto/cc/gcc | 35 | ||||
-rw-r--r-- | auto/cc/icc | 38 |
2 files changed, 58 insertions, 15 deletions
diff --git a/auto/cc/gcc b/auto/cc/gcc index c5b4e74ee..46b0aabb9 100644 --- a/auto/cc/gcc +++ b/auto/cc/gcc @@ -2,8 +2,15 @@ # Copyright (C) Igor Sysoev -# gcc 2.7.2.3, 2.8.1, 2.95.4, +# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2 # 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2 +# 4.0.0 + + +NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \ + | sed -e 's/^.* version \(.*\)/\1/'` + +echo " + gcc version: $NGX_GCC_VER" # Solaris 7's /usr/ccs/bin/as does not support "-pipe" @@ -24,7 +31,6 @@ if [ $ngx_found = yes ]; then PIPE="-pipe" fi - # optimizations #NGX_GCC_OPT="-O2" @@ -61,8 +67,12 @@ case $CPU in esac -# STUB for batch builds -if [ $CC = gcc27 ]; then CPU_OPT=; fi +case "$NGX_GCC_VER" in + 2.7*) + # batch build + CPU_OPT= + ;; +esac CFLAGS="$CFLAGS $PIPE $CPU_OPT" @@ -95,8 +105,21 @@ CFLAGS="$CFLAGS -Wall -Wpointer-arith" #CFLAGS="$CFLAGS -Wconversion" #CFLAGS="$CFLAGS -Winline" -# we have a lot of the unused function arguments -CFLAGS="$CFLAGS -Wno-unused" + +case "$NGX_GCC_VER" in + 3.* | 4.* ) + # we have a lot of the unused function arguments + CFLAGS="$CFLAGS -Wno-unused-parameter" + CFLAGS="$CFLAGS -Wno-unused-function" + #CFLAGS="$CFLAGS -Wunreachable-code" + ;; + + *) + # we have a lot of the unused function arguments + CFLAGS="$CFLAGS -Wno-unused" + ;; +esac + # stop on warning CFLAGS="$CFLAGS -Werror" diff --git a/auto/cc/icc b/auto/cc/icc index 47b91d781..b6ae759fb 100644 --- a/auto/cc/icc +++ b/auto/cc/icc @@ -7,7 +7,7 @@ # optimizations CFLAGS="$CFLAGS -O" -# inline functions declared with __inline +# inline the functions declared with __inline #CFLAGS="$CFLAGS -Ob1" # inline any function, at the compiler's discretion CFLAGS="$CFLAGS -Ob2" @@ -54,14 +54,34 @@ fi # warnings -CFLAGS="$CFLAGS -w1" -#CFLAGS="$CFLAGS -w2" - -# disable the ICC 8.1 errors: -# error #181: argument is incompatible with corresponding format -# string conversion -# error #269: invalid format string conversion -CFLAGS="$CFLAGS -wd181 -wd269" +CFLAGS="$CFLAGS -w2" + +# disable some warnings + +# invalid type conversion: "int" to "char *" +CFLAGS="$CFLAGS -wd171" +# argument is incompatible with corresponding format string conversion +CFLAGS="$CFLAGS -wd181" +# zero used for undefined preprocessing identifier +CFLAGS="$CFLAGS -wd193" +# invalid format string conversion +CFLAGS="$CFLAGS -wd269" +# conversion from "long long" to "size_t" may lose significant bits +CFLAGS="$CFLAGS -wd810" +# parameter was never referenced +CFLAGS="$CFLAGS -wd869" + +# STUB +# enumerated type mixed with another type +CFLAGS="$CFLAGS -wd188" +# controlling expression is constant +CFLAGS="$CFLAGS -wd279" +# operands are evaluated in unspecified order +CFLAGS="$CFLAGS -wd981" +# external definition with no prior declaration +CFLAGS="$CFLAGS -wd1418" +# external declaration in primary source file +CFLAGS="$CFLAGS -wd1419" # stop on warning CFLAGS="$CFLAGS -Werror" |