gcc-12.0.1-0.8.fc36 is annoying with false positives.
It's related to g_error() and its `for(;;) ;`.
For example:
../src/libnm-glib-aux/nm-shared-utils.c: In function 'nm_utils_parse_inaddr_bin_full':
../src/libnm-glib-aux/nm-shared-utils.c:1145:26: error: dangling pointer to 'error' may be used [-Werror=dangling-pointer=]
1145 | error->message);
| ^~
/usr/include/glib-2.0/glib/gmessages.h:343:32: note: in definition of macro 'g_error'
343 | __VA_ARGS__); \
| ^~~~~~~~~~~
../src/libnm-glib-aux/nm-shared-utils.c:1133:31: note: 'error' declared here
1133 | gs_free_error GError *error = NULL;
| ^~~~~
/usr/include/glib-2.0/glib/gmessages.h:341:25: error: dangling pointer to 'addrbin' may be used [-Werror=dangling-pointer=]
341 | g_log (G_LOG_DOMAIN, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
342 | G_LOG_LEVEL_ERROR, \
| ~~~~~~~~~~~~~~~~~~~~~~~
343 | __VA_ARGS__); \
| ~~~~~~~~~~~~
../src/libnm-glib-aux/nm-shared-utils.c:1141:13: note: in expansion of macro 'g_error'
1141 | g_error("unexpected assertion failure: could parse \"%s\" as %s, but not accepted by "
| ^~~~~~~
../src/libnm-glib-aux/nm-shared-utils.c:1112:14: note: 'addrbin' declared here
1112 | NMIPAddr addrbin;
| ^~~~~~~
I think the warning could potentially be useful and prevent real bugs.
So don't disable it altogether, but go through the effort to suppress it
at the places where it currently happens.
Note that NM_PRAGMA_WARNING_DISABLE_DANGLING_POINTER macro only expands
to suppressing the warning with __GNUC__ equal to 12. The purpose is to
only suppress the warning where we know we want to. Hopefully other gcc
versions don't have this problem.
I guess, we could also write a NM_COMPILER_WARNING() check in
"m4/compiler_options.m4", to disable the warning if we detect it. But
that seems too cumbersome.
|
||
|---|---|---|
| .. | ||
| tests | ||
| meson.build | ||
| nm-connection-private.h | ||
| nm-connection.c | ||
| nm-crypto-gnutls.c | ||
| nm-crypto-impl.h | ||
| nm-crypto-nss.c | ||
| nm-crypto-null.c | ||
| nm-crypto.c | ||
| nm-crypto.h | ||
| nm-dbus-utils.c | ||
| nm-default-libnm-core.h | ||
| nm-errors.c | ||
| nm-keyfile-utils.c | ||
| nm-keyfile.c | ||
| nm-meta-setting-base-impl.c | ||
| nm-property-compare.c | ||
| nm-property-compare.h | ||
| nm-setting-6lowpan.c | ||
| nm-setting-8021x.c | ||
| nm-setting-adsl.c | ||
| nm-setting-bluetooth.c | ||
| nm-setting-bond-port.c | ||
| nm-setting-bond.c | ||
| nm-setting-bridge-port.c | ||
| nm-setting-bridge.c | ||
| nm-setting-cdma.c | ||
| nm-setting-connection.c | ||
| nm-setting-dcb.c | ||
| nm-setting-dummy.c | ||
| nm-setting-ethtool.c | ||
| nm-setting-generic.c | ||
| nm-setting-gsm.c | ||
| nm-setting-hostname.c | ||
| nm-setting-infiniband.c | ||
| nm-setting-ip-config.c | ||
| nm-setting-ip-tunnel.c | ||
| nm-setting-ip4-config.c | ||
| nm-setting-ip6-config.c | ||
| nm-setting-macsec.c | ||
| nm-setting-macvlan.c | ||
| nm-setting-match.c | ||
| nm-setting-olpc-mesh.c | ||
| nm-setting-ovs-bridge.c | ||
| nm-setting-ovs-dpdk.c | ||
| nm-setting-ovs-external-ids.c | ||
| nm-setting-ovs-interface.c | ||
| nm-setting-ovs-patch.c | ||
| nm-setting-ovs-port.c | ||
| nm-setting-ppp.c | ||
| nm-setting-pppoe.c | ||
| nm-setting-private.h | ||
| nm-setting-proxy.c | ||
| nm-setting-serial.c | ||
| nm-setting-sriov.c | ||
| nm-setting-tc-config.c | ||
| nm-setting-team-port.c | ||
| nm-setting-team.c | ||
| nm-setting-tun.c | ||
| nm-setting-user.c | ||
| nm-setting-veth.c | ||
| nm-setting-vlan.c | ||
| nm-setting-vpn.c | ||
| nm-setting-vrf.c | ||
| nm-setting-vxlan.c | ||
| nm-setting-wifi-p2p.c | ||
| nm-setting-wimax.c | ||
| nm-setting-wired.c | ||
| nm-setting-wireguard.c | ||
| nm-setting-wireless-security.c | ||
| nm-setting-wireless.c | ||
| nm-setting-wpan.c | ||
| nm-setting.c | ||
| nm-simple-connection.c | ||
| nm-team-utils.c | ||
| nm-team-utils.h | ||
| nm-utils-private.h | ||
| nm-utils.c | ||
| nm-vpn-editor-plugin.c | ||
| nm-vpn-plugin-info.c | ||
| README.md | ||
libnm-core-impl
NetworkManager provides a client library libnm.
NetworkManager core does not (dynamically) link against all of libnm.
Instead, it statically links against a part of it.
That part is the static helper library libnm-core-impl.
libnm-core-impl implements (and provides) the API from
libnm-core-public, which is part of the public
API of libnm. In this form, libnm-core-impl is part
of the implementation of libnm. It also implements (and
provides) an internal API libnm-core-intern which
can only be used by those who link statically against libnm-core-impl.
Only NetworkManager core and libnm are allowed to statically
link with libnm-core-impl. Consequently, only those are allowed to include
libnm-core-intern.
This directory should not be added to the include search path of other
components as they are only allowed to include libnm-core-public
and libnm-core-intern.