Utilize --enable-warnings for SUNWspro
authorAndrew Deason <adeason@sinenomine.net>
Mon, 22 Nov 2010 02:20:42 +0000 (21:20 -0500)
committerDerrick Brashear <shadow@dementia.org>
Thu, 25 Nov 2010 21:19:48 +0000 (13:19 -0800)
Add the necessary options for the Solaris Studio compiler to enable
more warnings, when specified in the ./configure invocation.

Change-Id: I30e2a4a4bddad6beb4c50c3e10775c09916bf0df
Reviewed-on: http://gerrit.openafs.org/3367
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/cf/osconf.m4

index cd25b99..7a6ea2e 100644 (file)
@@ -1065,6 +1065,22 @@ if test "x$GCC" = "xyes"; then
       AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode])
     fi
   fi
+else
+  case $AFS_SYSNAME in
+    sun*_51?)
+      # Solaris Studio
+      warn_common="-v -errfmt=error -errtags=yes -erroff=E_ATTRIBUTE_UNKNOWN,E_END_OF_LOOP_CODE_NOT_REACHED"
+      if test "x$enable_warnings" = "xyes" ; then
+        XCFLAGS="${XCFLAGS} $warn_common"
+      fi
+      if test "x$enable_checking" != "xno" ; then
+        XCFLAGS="${XCFLAGS} $warn_common -errwarn=%all"
+        if test "x$enable_checking" != "xall" ; then
+          CFLAGS_NOERROR="-errwarn=%none"
+        fi
+      fi
+      ;;
+  esac
 fi
 
 dnl horribly cheating, assuming double / is ok.