mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-26 12:20:38 +01:00
introspection: avoid compiler warning in generated introspection files
Disable "-Wincompatible-pointer-types-discards-qualifiers" warning, as
this breaks build of the gdbus-codegen files.
With glib2-2.67.0-1.fc34.x86_64.rpm, clang-11.0.0-2.fc34.x86_64.rpm, we
get a failure to build generated code:
introspection/org.freedesktop.NetworkManager.AccessPoint.c:438:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
G_DEFINE_INTERFACE (NMDBusAccessPoint, nmdbus_access_point, G_TYPE_OBJECT)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:1784:47: note: expanded from macro 'G_DEFINE_INTERFACE'
#define G_DEFINE_INTERFACE(TN, t_n, T_P) G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, ;)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:1803:61: note: expanded from macro 'G_DEFINE_INTERFACE_WITH_CODE'
#define G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TN, t_n, T_P) {_C_;} _G_DEFINE_INTERFACE_EXTENDED_END()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:2042:7: note: expanded from macro '_G_DEFINE_INTERFACE_EXTENDED_BEGIN'
if (g_once_init_enter (&g_define_type_id__volatile)) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
(!g_atomic_pointer_get (location) && \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
__atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
^~~~~~~~~~~~~~~~~
introspection/org.freedesktop.NetworkManager.AccessPoint.c:944:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
G_DEFINE_TYPE_WITH_CODE (NMDBusAccessPointProxy, nmdbus_access_point_proxy, G_TYPE_DBUS_PROXY,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:1615:56: note: expanded from macro 'G_DEFINE_TYPE_WITH_CODE'
#define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:2032:3: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN'
_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:2000:7: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER'
if (g_once_init_enter (&g_define_type_id__volatile)) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
(!g_atomic_pointer_get (location) && \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
__atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
^~~~~~~~~~~~~~~~~
introspection/org.freedesktop.NetworkManager.AccessPoint.c:1729:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
G_DEFINE_TYPE_WITH_CODE (NMDBusAccessPointSkeleton, nmdbus_access_point_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:1615:56: note: expanded from macro 'G_DEFINE_TYPE_WITH_CODE'
#define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:2032:3: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN'
_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:2000:7: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER'
if (g_once_init_enter (&g_define_type_id__volatile)) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
(!g_atomic_pointer_get (location) && \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
__atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
^~~~~~~~~~~~~~~~~
(cherry picked from commit 03d9ec27fa)
(cherry picked from commit 595c5854ad)
(cherry picked from commit 3a31fc459a)
(cherry picked from commit cb28b6a00b)
(cherry picked from commit 983f87c5b2)
(cherry picked from commit 5c317a86e2)
This commit is contained in:
parent
2bb5c8cf09
commit
5af2647708
5 changed files with 16 additions and 3 deletions
13
Makefile.am
13
Makefile.am
|
|
@ -84,6 +84,8 @@ completiondir = $(datadir)/bash-completion/completions
|
|||
|
||||
nmlocaledir = $(datadir)/locale
|
||||
|
||||
INTROSPECTION_EXTRA_CFLAGS = -Wno-incompatible-pointer-types-discards-qualifiers
|
||||
|
||||
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
|
||||
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
|
||||
|
||||
|
|
@ -493,7 +495,10 @@ shared_nm_utils_tests_test_shared_general_LDADD = \
|
|||
noinst_LTLIBRARIES += \
|
||||
introspection/libnmdbus.la
|
||||
|
||||
introspection_libnmdbus_la_CPPFLAGS = $(GLIB_CFLAGS)
|
||||
introspection_libnmdbus_la_CPPFLAGS = \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(INTROSPECTION_EXTRA_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
introspection_sources = \
|
||||
introspection/org.freedesktop.NetworkManager.AccessPoint.c \
|
||||
|
|
@ -2792,7 +2797,10 @@ nodist_src_settings_plugins_ifcfg_rh_libnmdbus_ifcfg_rh_la_SOURCES = \
|
|||
src/settings/plugins/ifcfg-rh/nmdbus-ifcfg-rh.c \
|
||||
src/settings/plugins/ifcfg-rh/nmdbus-ifcfg-rh.h
|
||||
|
||||
src_settings_plugins_ifcfg_rh_libnmdbus_ifcfg_rh_la_CPPFLAGS = $(filter-out -DGLIB_VERSION_MAX_ALLOWED%,$(src_cppflags_base))
|
||||
src_settings_plugins_ifcfg_rh_libnmdbus_ifcfg_rh_la_CPPFLAGS = \
|
||||
$(filter-out -DGLIB_VERSION_MAX_ALLOWED%,$(src_cppflags_base)) \
|
||||
$(INTROSPECTION_EXTRA_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CLEANFILES += $(nodist_src_settings_plugins_ifcfg_rh_libnmdbus_ifcfg_rh_la_SOURCES)
|
||||
|
||||
|
|
@ -3964,6 +3972,7 @@ dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \
|
|||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(SANITIZER_EXEC_CFLAGS) \
|
||||
$(INTROSPECTION_EXTRA_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
dispatcher_tests_test_dispatcher_envp_LDFLAGS = \
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ exe = executable(
|
|||
c_args: [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||
],
|
||||
] + introspection_extra_cflags,
|
||||
link_with: libnm_dispatcher_core,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ libnmdbus = static_library(
|
|||
sources: sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: glib_dep,
|
||||
c_args: introspection_extra_cflags,
|
||||
)
|
||||
|
||||
libnmdbus_dep = declare_dependency(
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ nm_pkgstatedir = join_paths(nm_localstatedir, 'lib', nm_name)
|
|||
nm_vpndir = join_paths(nm_libdir, nm_name)
|
||||
nm_plugindir = join_paths(nm_libdir, nm_name, dist_version)
|
||||
|
||||
introspection_extra_cflags = ['-Wno-incompatible-pointer-types-discards-qualifiers']
|
||||
|
||||
libnm_name = 'libnm'
|
||||
|
||||
current = 1
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ libnmdbus_ifcfg_rh = static_library(
|
|||
name,
|
||||
sources: dbus_sources,
|
||||
dependencies: glib_dep,
|
||||
c_args: introspection_extra_cflags,
|
||||
)
|
||||
|
||||
core_sources = files(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue