charmc: learn how to treat compiler warnings as errors
authorPhil Miller <mille121@illinois.edu>
Tue, 13 Mar 2012 04:38:05 +0000 (23:38 -0500)
committerPhil Miller <mille121@illinois.edu>
Tue, 13 Mar 2012 06:12:55 +0000 (01:12 -0500)
src/arch/net-linux-x86_64/conv-mach.sh
src/scripts/charmc

index 448dafbfc4ae78402c13a013df025fc8719607fb..fc3b576ae6d200752a4a8447aa97d7b3fed59474 100644 (file)
@@ -15,6 +15,7 @@ CMK_LD_LIBRARY_PATH="-Wl,-rpath,$CHARMLIBSO/"
 CMK_LIBS="-lckqt"
 CMK_RANLIB="ranlib"
 CMK_CC64=true
+CMK_WARNINGS_ARE_ERRORS="-Werror"
 
 # native compiler for compiling charmxi, etc
 CMK_NATIVE_CC="$CMK_CC $CMK_AMD64 -fPIC $CMK_DEFS "
index 2890ef840b38064fc10068ff8328875487385664..a2edbe1a6e096fbf41c3ce7c4583964e459232f5 100755 (executable)
@@ -683,6 +683,14 @@ do
                fi
                ;;
 
+        -Werror)
+                WERROR="1"
+                ;;
+
+        -Wno-error)
+                WERROR="0"
+                ;;
+
        -LANG*)
                Warning "passing unrecognized option $arg to all compilers and linkers"
                OPTS="$OPTS $arg"
@@ -816,6 +824,11 @@ fi
 
 PROCESSED_MODULES=""
 
+if [ "$WERROR" = "1" ]
+then
+    OPTS="$OPTS $CMK_WARNINGS_ARE_ERRORS"
+fi
+
 # Look up and add the dependencies for module $1
 findModuleDep() {
        M=$1