summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-02-07 11:23:08 +0100
committerLubomir Rintel <lkundrak@v3.sk>2018-07-30 07:55:13 +0200
commit8946bc73b24dac66299646843e1fbf4c38230f9d (patch)
tree55c9a8eb70b6e3c899c54f7c0ca24192588dfeb9
parent273c650cb679d53339394cd4204da4633c671ebe (diff)
downloadnetwork-manager-applet-8946bc73b24dac66299646843e1fbf4c38230f9d.tar.gz
m4: disable -Wcast-function-type
This fixes the GCC 8 build. It disables the warning conditionally so that we get the warning back if glib gets fixed. (Taken from NetworkManager commit 631982a796a0eeb412551c61469a1cfb83e3f438)
-rw-r--r--m4/compiler_options.m410
1 files changed, 10 insertions, 0 deletions
diff --git a/m4/compiler_options.m4 b/m4/compiler_options.m4
index d1363010..dec5723d 100644
--- a/m4/compiler_options.m4
+++ b/m4/compiler_options.m4
@@ -127,6 +127,16 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
[union { int a[1]; int b[2]; } c = { 0 }]
)
+ dnl a new warning in gcc 8, glib 2.55 doesn't play nice yet
+ NM_COMPILER_WARNING([cast-function-type],
+ [#include <glib-object.h>]
+ [typedef struct { GObject parent; } NMObject;]
+ [typedef struct { GObjectClass parent; } NMObjectClass;]
+ [static void nm_object_init (NMObject *object) { } ]
+ [static void nm_object_class_init (NMObjectClass *object) { }]
+ [G_DEFINE_TYPE (NMObject, nm_object, G_TYPE_OBJECT)]
+ )
+
CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS"
else
AC_MSG_RESULT(no)