Limit GCC 6 pragmas.

-Wnull-dereference and -Wshift-overflow are new warnings in GCC 6, so do
not try to disable them with pragmas on older GCC versions.

Fixes commit a8e15ea924.
This commit is contained in:
Pino Toscano
2016-07-25 19:45:03 +02:00
parent 5363502a38
commit 7b90ff3fc8
5 changed files with 10 additions and 0 deletions

View File

@@ -31,7 +31,9 @@
/* GCC can't work out that the YAJL_IS_<foo> test is sufficient to
* ensure that YAJL_GET_<foo> later doesn't return NULL.
*/
#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */
#pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
#define Val_none (Val_int (0))

View File

@@ -990,7 +990,9 @@ do_internal_rhbz914931 (int count)
}
#pragma GCC diagnostic push
#if defined(__GNUC__) && GUESTFS_GCC_VERSION >= 60000 /* gcc >= 6 */
#pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
static void
deliberately_cause_a_segfault (void)

View File

@@ -35,7 +35,9 @@
/* GCC can't work out that the YAJL_IS_<foo> test is sufficient to
* ensure that YAJL_GET_<foo> later doesn't return NULL.
*/
#if defined(__GNUC__) && GUESTFS_GCC_VERSION >= 60000 /* gcc >= 6 */
#pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
GUESTFSD_EXT_CMD(str_ldmtool, ldmtool);

View File

@@ -69,7 +69,9 @@
/* errors in <gtk.h> */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */
#pragma GCC diagnostic ignored "-Wshift-overflow"
#endif
#include <gtk/gtk.h>
#pragma GCC diagnostic pop

View File

@@ -36,7 +36,9 @@
/* errors in <gtk.h> */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */
#pragma GCC diagnostic ignored "-Wshift-overflow"
#endif
#include <gtk/gtk.h>
#pragma GCC diagnostic pop