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); \ ^~~~~~~~~~~~~~~~~
This commit is contained in:
13
Makefile.am
13
Makefile.am
@@ -85,6 +85,8 @@ completiondir = $(datadir)/bash-completion/completions
|
|||||||
|
|
||||||
nmlocaledir = $(datadir)/locale
|
nmlocaledir = $(datadir)/locale
|
||||||
|
|
||||||
|
INTROSPECTION_EXTRA_CFLAGS = -Wno-incompatible-pointer-types-discards-qualifiers
|
||||||
|
|
||||||
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
|
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
|
||||||
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
|
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
|
||||||
|
|
||||||
@@ -677,7 +679,10 @@ endif
|
|||||||
|
|
||||||
noinst_LTLIBRARIES += introspection/libnmdbus.la
|
noinst_LTLIBRARIES += introspection/libnmdbus.la
|
||||||
|
|
||||||
introspection_libnmdbus_la_CPPFLAGS = $(GLIB_CFLAGS)
|
introspection_libnmdbus_la_CPPFLAGS = \
|
||||||
|
$(GLIB_CFLAGS) \
|
||||||
|
$(INTROSPECTION_EXTRA_CFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
introspection_sources = \
|
introspection_sources = \
|
||||||
introspection/org.freedesktop.NetworkManager.AccessPoint.c \
|
introspection/org.freedesktop.NetworkManager.AccessPoint.c \
|
||||||
@@ -3023,7 +3028,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.c \
|
||||||
src/settings/plugins/ifcfg-rh/nmdbus-ifcfg-rh.h
|
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)
|
CLEANFILES += $(nodist_src_settings_plugins_ifcfg_rh_libnmdbus_ifcfg_rh_la_SOURCES)
|
||||||
|
|
||||||
@@ -4318,6 +4326,7 @@ dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \
|
|||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||||
$(GLIB_CFLAGS) \
|
$(GLIB_CFLAGS) \
|
||||||
$(SANITIZER_EXEC_CFLAGS) \
|
$(SANITIZER_EXEC_CFLAGS) \
|
||||||
|
$(INTROSPECTION_EXTRA_CFLAGS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
dispatcher_tests_test_dispatcher_envp_SOURCES = \
|
dispatcher_tests_test_dispatcher_envp_SOURCES = \
|
||||||
|
@@ -2,22 +2,18 @@
|
|||||||
|
|
||||||
test_unit = 'test-dispatcher-envp'
|
test_unit = 'test-dispatcher-envp'
|
||||||
|
|
||||||
deps = [
|
|
||||||
libnm_nm_default_dep,
|
|
||||||
libnm_utils_base_dep,
|
|
||||||
]
|
|
||||||
|
|
||||||
c_flags = [
|
|
||||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
|
||||||
]
|
|
||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
[test_unit + '.c', nmdbus_dispatcher_sources],
|
[test_unit + '.c', nmdbus_dispatcher_sources],
|
||||||
include_directories: dispatcher_inc,
|
include_directories: dispatcher_inc,
|
||||||
dependencies: deps,
|
dependencies: [
|
||||||
c_args: c_flags,
|
libnm_nm_default_dep,
|
||||||
|
libnm_utils_base_dep,
|
||||||
|
],
|
||||||
|
c_args: [
|
||||||
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||||
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||||
|
] + introspection_extra_cflags,
|
||||||
link_with: libnm_dispatcher_core,
|
link_with: libnm_dispatcher_core,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -104,6 +104,7 @@ libnmdbus = static_library(
|
|||||||
sources: sources,
|
sources: sources,
|
||||||
include_directories: top_inc,
|
include_directories: top_inc,
|
||||||
dependencies: glib_dep,
|
dependencies: glib_dep,
|
||||||
|
c_args: introspection_extra_cflags,
|
||||||
)
|
)
|
||||||
|
|
||||||
libnmdbus_dep = declare_dependency(
|
libnmdbus_dep = declare_dependency(
|
||||||
|
@@ -56,6 +56,8 @@ nm_pkgstatedir = join_paths(nm_localstatedir, 'lib', nm_name)
|
|||||||
nm_vpndir = join_paths(nm_libdir, nm_name)
|
nm_vpndir = join_paths(nm_libdir, nm_name)
|
||||||
nm_plugindir = join_paths(nm_libdir, nm_name, dist_version)
|
nm_plugindir = join_paths(nm_libdir, nm_name, dist_version)
|
||||||
|
|
||||||
|
introspection_extra_cflags = ['-Wno-incompatible-pointer-types-discards-qualifiers']
|
||||||
|
|
||||||
libnm_name = 'libnm'
|
libnm_name = 'libnm'
|
||||||
|
|
||||||
current = 1
|
current = 1
|
||||||
|
@@ -18,6 +18,7 @@ libnmdbus_ifcfg_rh = static_library(
|
|||||||
name,
|
name,
|
||||||
sources: dbus_sources,
|
sources: dbus_sources,
|
||||||
dependencies: glib_dep,
|
dependencies: glib_dep,
|
||||||
|
c_args: introspection_extra_cflags,
|
||||||
)
|
)
|
||||||
|
|
||||||
core_sources = files(
|
core_sources = files(
|
||||||
|
Reference in New Issue
Block a user