NetworkManager/src/libnm-core-impl
Thomas Haller dab2ee8ac5
all: suppress wrong gcc-12 warning "-Wdangling-pointer"
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.
2022-02-21 19:50:52 +01:00
..
tests all: suppress wrong gcc-12 warning "-Wdangling-pointer" 2022-02-21 19:50:52 +01:00
meson.build libnm-crypto: add new option for no cryptography 2022-02-21 19:12:27 +01:00
nm-connection-private.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-connection.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-crypto-gnutls.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-crypto-impl.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-crypto-nss.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-crypto-null.c libnm-crypto: add new option for no cryptography 2022-02-21 19:12:27 +01:00
nm-crypto.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-crypto.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-dbus-utils.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-default-libnm-core.h build: move "shared/nm-{glib-aux,log-null,log-core}" to "src/libnm-{glib-aux,log-null,log-core}" 2021-02-24 12:48:20 +01:00
nm-errors.c build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00
nm-keyfile-utils.c keyfile: write ethernet group always on the top of the file 2022-02-11 12:26:01 +01:00
nm-keyfile.c keyfile: do not write empty string list properties 2022-02-11 12:26:01 +01:00
nm-meta-setting-base-impl.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-property-compare.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-property-compare.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-6lowpan.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-8021x.c all: don't use strlen() to check whether string is empty/non-empty 2022-01-18 16:22:12 +01:00
nm-setting-adsl.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-bluetooth.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-bond-port.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-bond.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-bridge-port.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-bridge.c libnm: for embedded private structure in NMSetting set the offset to zero 2022-01-18 16:22:45 +01:00
nm-setting-cdma.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-connection.c libnm: rework strv properties of NMSetting as "direct" properties 2022-02-10 22:30:27 +01:00
nm-setting-dcb.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-dummy.c libnm: extend NMSettInfoSetting with an offset to the private data 2021-07-12 13:34:40 +02:00
nm-setting-ethtool.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-generic.c libnm: extend NMSettInfoSetting with an offset to the private data 2021-07-12 13:34:40 +02:00
nm-setting-gsm.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-hostname.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-infiniband.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-ip-config.c libnm: change error message about routing-rules without priority 2022-02-18 20:12:43 +01:00
nm-setting-ip-tunnel.c libnm: cleanup redundant code for direct properties of NMSetting 2022-01-18 16:22:32 +01:00
nm-setting-ip4-config.c libnm/doc: describe routing-rules in man nm-settings-nmcli 2022-02-09 23:10:58 +01:00
nm-setting-ip6-config.c libnm/doc: describe routing-rules in man nm-settings-nmcli 2022-02-09 23:10:58 +01:00
nm-setting-macsec.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-macvlan.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-match.c libnm: rework strv properties of NMSetting as "direct" properties 2022-02-10 22:30:27 +01:00
nm-setting-olpc-mesh.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-ovs-bridge.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-ovs-dpdk.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-ovs-external-ids.c libnm: for embedded private structure in NMSetting set the offset to zero 2022-01-18 16:22:45 +01:00
nm-setting-ovs-interface.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-ovs-patch.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-ovs-port.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-ppp.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-pppoe.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-private.h libnm: add direct strv type for NMSetting and use it for "match.interface-name" 2022-02-10 22:30:27 +01:00
nm-setting-proxy.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-serial.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-sriov.c libnm: change NMVariantAttributeSpec.str_type to work for attributes of any type 2022-02-09 19:13:02 +01:00
nm-setting-tc-config.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-team-port.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-team.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-tun.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-user.c libnm: for embedded private structure in NMSetting set the offset to zero 2022-01-18 16:22:45 +01:00
nm-setting-veth.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-vlan.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-vpn.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-vrf.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-vxlan.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-wifi-p2p.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-wimax.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-wired.c libnm: cleanup redundant code for direct properties of NMSetting 2022-01-18 16:22:32 +01:00
nm-setting-wireguard.c libnm: fix bug verifying private-key for WireGuard setting 2022-01-20 22:22:41 +01:00
nm-setting-wireless-security.c libnm: refactor some NMSetting to use direct properties for string 2022-01-18 16:22:28 +01:00
nm-setting-wireless.c libnm: cleanup redundant code for direct properties of NMSetting 2022-01-18 16:22:32 +01:00
nm-setting-wpan.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting.c libnm: add direct strv type for NMSetting and use it for "match.interface-name" 2022-02-10 22:30:27 +01:00
nm-simple-connection.c libnm: don't clear secrets during NMSimpleConnection:dispose() 2022-01-19 13:42:17 +01:00
nm-team-utils.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-team-utils.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-utils-private.h libnm: add flag to map zero to NULL in _nm_utils_ipaddr_canonical_or_invalid() 2022-01-18 16:22:17 +01:00
nm-utils.c libnm: add flag to map zero to NULL in _nm_utils_ipaddr_canonical_or_invalid() 2022-01-18 16:22:17 +01:00
nm-vpn-editor-plugin.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-vpn-plugin-info.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
README.md build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00

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.