← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba

 

Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/pjl-misc into lp:zorba.

Requested reviews:
  Paul J. Lucas (paul-lucas)

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/121978

Suppressed warnings; moved gcc diagnostic push macros to config.h.
-- 
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/121978
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/config.h.cmake'
--- include/zorba/config.h.cmake	2012-08-29 11:12:58 +0000
+++ include/zorba/config.h.cmake	2012-08-30 03:04:19 +0000
@@ -147,6 +147,16 @@
 # define ZORBA_TR1_NS std
 #endif
 
+////////// GCC diagnostics ////////////////////////////////////////////////////
+
+#if defined( __GNUC__ ) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 460)
+# define GCC_GREATER_EQUAL_460 1
+#endif
+
+#if defined( GCC_GREATER_EQUAL_460 ) || defined( __llvm__ )
+# define GCC_PRAGMA_DIAGNOSTIC_PUSH 1
+#endif
+
 ////////// Zorba //////////////////////////////////////////////////////////////
 
 // Version

=== modified file 'src/util/icu_streambuf.cpp'
--- src/util/icu_streambuf.cpp	2012-08-29 11:12:58 +0000
+++ src/util/icu_streambuf.cpp	2012-08-30 03:04:19 +0000
@@ -25,6 +25,7 @@
 #include <cassert>
 #include <stdexcept>
 
+#include <zorba/config.h>
 #include <zorba/diagnostic_list.h>
 
 #include "diagnostics/assert.h"
@@ -177,6 +178,16 @@
   return c;
 }
 
+#ifdef __GNUC__
+# ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH
+#   pragma GCC diagnostic push
+# endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */
+//
+// Disables warnings about p.pivot_buf_ + sizeof p.pivot_buf_.
+//
+# pragma GCC diagnostic ignored "-Warray-bounds"
+#endif /* __GNUC__ */
+
 bool icu_streambuf::to_external( char_type const **from,
                                  char_type const *from_end, char **to,
                                  char const *to_end, bool flush ) {
@@ -215,6 +226,10 @@
   return true;
 }
 
+#ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH
+# pragma GCC diagnostic pop
+#endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */
+
 icu_streambuf::int_type icu_streambuf::underflow() {
 #if ZORBA_DEBUG_ICU_STREAMBUF
   printf( "underflow()\n" );


Follow ups