[or-cvs] [tor/master] Use -Wno-system-headers on openbsd to resolve 2nd case of bug1848

nickm at torproject.org nickm at torproject.org
Thu Aug 26 18:33:04 UTC 2010


Author: Nick Mathewson <nickm at torproject.org>
Date: Tue, 24 Aug 2010 13:43:53 -0400
Subject: Use -Wno-system-headers on openbsd to resolve 2nd case of bug1848
Commit: 30b766ba129c5eaefacd70fe29b482fb63ebfffe

---
 changes/openbsd-sysheaders |    4 ++++
 configure.in               |   11 ++++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)
 create mode 100644 changes/openbsd-sysheaders

diff --git a/changes/openbsd-sysheaders b/changes/openbsd-sysheaders
new file mode 100644
index 0000000..2babde2
--- /dev/null
+++ b/changes/openbsd-sysheaders
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - When building with --enable-gcc-warnings on OpenBSD, disable
+      warnings in system headers.  This makes --enable-gcc-warnings
+      pass on OpenBSD 4.8.
\ No newline at end of file
diff --git a/configure.in b/configure.in
index 34544e2..68c593a 100644
--- a/configure.in
+++ b/configure.in
@@ -819,6 +819,15 @@ if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xy
                     have_shorten64_flag=no)
   CFLAGS="$save_CFLAGS"
 
+  case $host in
+    *-*-openbsd*)
+      # Some OpenBSD versions (like 4.8) have -Wsystem-headers by default.
+      # That's fine, except that the headers don't pass -Wredundant-decls.
+      # Therefore, let's disable -Wsystem-headers when we're building
+      # with maximal warnings on OpenBSD.
+      CFLAGS="$CFLAGS -Wno-system-headers" ;;
+  esac
+
   CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum"
   if test x$enable_gcc_warnings = xyes; then
     CFLAGS="$CFLAGS -Werror"
@@ -826,7 +835,7 @@ if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xy
 
   # Disabled, so we can use mallinfo(): -Waggregate-return
 
-  if test x$have_gcc4 = xyes ; then 
+  if test x$have_gcc4 = xyes ; then
     # These warnings break gcc 3.3.5 and work on gcc 4.0.2
     CFLAGS="$CFLAGS -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement -Wold-style-definition"
   fi
-- 
1.7.1



More information about the tor-commits mailing list