NetworkManager/m4
Thomas Haller 1d63271a8d
build: set CFLAGS "-Wno-error=maybe-uninitialized" with LTO build
With LTO builds we get "-Wmaybe-uninitialized" warnings, which break
the build.

These seem false positives to me, due to aggressive inlining. But also
suppressing them with a pragma does not work. So, make them non-fatal
altogether. That is unfortunate, because this warning would be useful
to catch bugs.

Interestingly, when building --with-more-asserts, then the build passes
without warning. Probably because then the inlining doesn't happen.

    libtool: link: gcc -Wall -Werror -Wno-stringop-overflow -Wextra -Wdeclaration-after-statement -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wpointer-arith -Wshadow -Wshift-negative-value -Wstrict-prototypes -Wundef -Wvla -Wno-duplicate-decl-specifier -Wno-format-truncation -Wno-format-y2k -Wno-missing-field-initializers -Wno-pragmas -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-array-bounds -Wunused-value -Wcast-function-type -Wimplicit-fallthrough -fno-strict-aliasing -fdata-sections -ffunction-sections -Wl,--gc-sections -flto -flto-partition=none -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o src/platform/tests/test-platform-general src/platform/tests/test_platform_general-test-platform-general.o  src/.libs/libNetworkManagerTest.a -luuid -lgnutls -lsystemd -lndp -lselinux -L/lib64 -laudit -lpsl -lcurl -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -ludev -ldl -pthread
    src/platform/nm-linux-platform.c: In function 'ip_route_add':
    src/platform/nm-platform.c:4761:24: error: 'MEM[(struct NMPlatformIPRoute *)&obj + 24B].rt_source' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4761 |     route->rt_source = nmp_utils_ip_config_source_round_trip_rtprot(route->rt_source);
          |                        ^
    src/platform/nm-platform.h:2139:25: error: 'BIT_FIELD_REF <MEM[(const struct NMPlatformIPRoute *)&obj + 24B], 8, 72>' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2139 |     return r->table_any ? 254u /* RT_TABLE_MAIN */
          |                         ^
    lto1: all warnings being treated as errors
    lto-wrapper: fatal error: gcc returned 1 exit status
2021-01-08 12:17:58 +01:00
..
attributes.m4 build: import attributes.m4 from systemd 2016-06-03 22:19:37 +02:00
ax_lib_readline.m4 build: correct help message about missing readline + termcap libraries 2015-05-11 10:33:21 -05:00
compiler_options.m4 build: set CFLAGS "-Wno-error=maybe-uninitialized" with LTO build 2021-01-08 12:17:58 +01:00
git-sha-record.m4 build: move detection of NM_GIT_SHA to separate "m4/git-sha-record.m4" 2016-09-14 14:11:07 +02:00
gnome-code-coverage.m4 build: disable lcov version check 2017-10-20 17:16:22 +02:00
introspection.m4 build: remove subshells and fix invalid test syntax 2020-04-20 08:54:38 +02:00
vapigen.m4 build: document defaults consistently 2019-04-16 15:57:20 +02:00