Blob
- Date:
- Message:
- fix clang 3.4 warnings and ignore uninteresting ones fixed warnings: src/cmd/fossil/disk.c:37:14: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] src/cmd/fossil/disk.c:38:14: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] src/cmd/fossil/disk.c:39:14: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] src/cmd/fossil/disk.c:40:13: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] src/cmd/fossil/disk.c:41:14: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] src/libndb/ndbreorder.c:41:55: warning: for loop has empty body [-Wempty-body] ignored warnings: src/cmd/acid/dbg.y:393:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/bc.y:1327:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/bc.y:1327:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/grep/grep.y:420:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/grep/grep.y:420:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/hoc/hoc.y:692:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/hoc/hoc.y:692:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/lex/parser.y:886:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/rc/syn.y:303:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/cmd/units.y:1003:9: warning: array index -1 is before the beginning of the array [-Warray-bounds] src/libregexp/regcomp.c:19:16: warning: variable 'reprog' is not needed and will not be emitted [-Wunneeded-internal-declaration] LGTM=rsc R=rsc https://codereview.appspot.com/158250043
- Actions:
- History | Blame | Raw File
1 #!/bin/sh3 test -f $PLAN9/config && . $PLAN9/config4 usegcc()5 {6 cc=${CC9:-gcc}7 ngflags=" \8 -O2 \9 -c \10 -Wall \11 -Wno-parentheses \12 -Wno-missing-braces \13 -Wno-switch \14 -Wno-comment \15 -Wno-sign-compare \16 -Wno-unknown-pragmas \17 -fno-omit-frame-pointer \18 -fsigned-char \19 "20 # want to put -fno-optimize-sibling-calls here but21 # that option only works with gcc3+ it seems22 cflags="$ngflags -ggdb"23 }25 quiet()26 {27 # The uniq at the end is for gcc's strcmp/etc. built-in nonsense,28 # which multiplies single errors as a result of its expansion.29 # The "Cursor. is deprecated" kills off warnings from Apple30 # about using SetCursor/InitCursor. (Okay, they're deprecated,31 # but you could at least tell us what to use instead, Apple!)33 ignore=': error: .Each undeclared identifier'34 ignore=$ignore'|: error: for each function it appears'35 ignore=$ignore'|is dangerous, better use'36 ignore=$ignore'|is almost always misused'37 ignore=$ignore'|: In function '38 ignore=$ignore'|: At top level:'39 ignore=$ignore'|support .long long.'40 ignore=$ignore'|In file included from'41 ignore=$ignore'| from'42 ignore=$ignore'|use of C99 long long'43 ignore=$ignore'|ISO C forbids conversion'44 ignore=$ignore'|is deprecated'45 ignore=$ignore'|warn_unused_result'47 grep -v '__p9l_autolib_' $1 |48 egrep -v "$ignore" |49 sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |50 $(which uniq) 1>&2 # avoid built-in uniq on SunOS51 }53 useclang()54 {55 cc=${CC9:-clang}56 ngflags=" \57 -O2 \58 -c \59 -Wall \60 -Wno-parentheses \61 -Wno-missing-braces \62 -Wno-switch \63 -Wno-comment \64 -Wno-sign-compare \65 -Wno-unknown-pragmas \66 -Wno-empty-body \67 -Wno-unused-value \68 -Wno-array-bounds \69 -Wno-gnu-designator \70 -Wno-array-bounds \71 -Wno-unneeded-internal-declaration \72 -fsigned-char \73 -fno-caret-diagnostics \74 "75 cflags="$ngflags -g"76 }78 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"79 case "$tag" in80 *FreeBSD*gcc*) usegcc ;;81 *FreeBSD*clang*) useclang ;;82 *DragonFly*|*BSD*) usegcc ;;83 *Darwin-x86_64*clang*)84 useclang85 cflags="$ngflags -g3 -m64"86 ;;87 *Darwin-x86_64*) usegcc88 cflags="$ngflags -g3 -no-cpp-precomp -m64" ;;89 *Darwin*clang*)90 useclang91 cflags="$ngflags -g3 -m32"92 ;;93 *Darwin*) usegcc94 cflags="$ngflags -g3 -no-cpp-precomp -m32" ;;95 *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;96 *Linux*) usegcc97 case "${CC9:-gcc}" in98 tcc)99 cc=tcc100 cflags="-c -g"101 ;;102 esac103 case "${SYSVERSION:-`uname -r`}" in104 2.4.*)105 cflags="$cflags -D__Linux24__"106 ;;107 2.6.*)108 cflags="$cflags -D__Linux26__"109 ;;110 esac111 ;;112 *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;;113 *SunOS*-cc) cc=cc;114 cflags="-mt -g -O -c -xCC -D__sun__"115 u=`uname`116 v=`uname -r`117 s=`echo $u$v | tr '. ' '__'`118 cflags="$cflags -D__${s}__"119 ;;120 *SunOS*-gcc) usegcc121 u=`uname`122 v=`uname -r`123 s=`echo $u$v | tr '. ' '__'`124 cflags="$ngflags -g"125 cflags="$cflags -D__sun__ -D__${s}__"126 ;;127 *AIX*) usegcc128 cflags="$ngflags -g -D__AIX__"129 ;;130 *)131 echo 9c does not know how to compile on "$tag" 1>&2132 exit 1133 esac135 # N.B. Must use temp file to avoid pipe; pipe loses status.136 xtmp=/tmp/9c.$$.$USER.out137 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp138 status=$?139 quiet $xtmp140 rm -f $xtmp141 exit $status