Commit Graph

12 Commits

Author SHA1 Message Date
Thomas Haller
0462104317 build: fix detecting support for -Wno-* compiler flags
Since GCC 4.4, gcc does not warn about unknown -Wno-* flags. At
least, it does not warning unless another warning is raised as well
(https://gcc.gnu.org/wiki/FAQ#wnowarning).

We didn't notice up to now, because we only tested flags that GCC
actually supports.

Hack around this, by checking for the -W* counterpart instead.
2015-02-24 18:43:44 +01:00
Dan Williams
d2dd3b2c90 dhcp: add systemd-based "internal" DHCP client
We must also remove -Waggregate-return from m4/compiler-warnings.m4 because systemd
uses aggregate return (correctly) in a couple cases, and we cannot keep single-level
makefiles and override aggregate-return only for the systemd sub-library.

This client currently only supports DHCPv4 because the base systemd code
does not yet fully support DHCPv6.
2014-11-06 22:42:43 -06:00
Thomas Haller
f1a0b4afd2 build: renable -Wstrict-prototypes compiler warning
The warning -Wstrict-prototypes was disabled by commit
db9b1df0e4 .

Enable it again, but avoid warnings for WiMax SDK by explicitly disabling the
compiler warning where needed.

Apparently clang does not produce a warning for -Wstrict-prototypes,
hence we don't need a clang specific #pragma.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 14:09:52 +01:00
Thomas Haller
dd243ceefe build: refactor compiler_warnings.m4 macro
NM_COMPILER_WARNINGS still works the same, but
rename variables to have a CFLAGS_* prefix.

Also cleanup the construction of CFLAGS by appending
to CFLAGS_MORE_WARNINGS variable instead of appending
to CFLAGS, and resetting to SAVE_CFLAGS.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 12:40:03 +01:00
Thomas Haller
5009f2c7a3 build/clang: fix detection of valid warning compiler flags
clang does not exit with error when it is called with an
unrecognized (warning) option. Instead it just prints
a warning that makes the configure script believe the
warning is supported. Later, during build we might pass
-Werror, which causes clang to fail due to unrecognized
arguments.

Fix the script to detect compiler warnings by passing
'-Werror=unknown-warning-option', which lets clang fail too.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:16:33 +02:00
Dan Winship
ece92fe67a build: add -Wformat-security to the default warning flags 2014-04-02 09:24:56 -04:00
Dan Williams
bb363997ed build: add some more build-time warnings 2012-07-30 10:58:47 -05:00
Colin Walters
e4f51d1968 build: allow --set-more-warnings=no|yes|error
For the GNOME autobuilders, we want compiler warnings, but don't want
-Werror.  For developer compatibility, the default value is "error".

https://bugzilla.gnome.org/show_bug.cgi?id=668974
2012-02-09 16:54:04 -06:00
Dan Williams
db9b1df0e4 build: don't use -Wstrict-prototypes (bgo #584947)
First, -Wstrict-prototypes wasn't actually getting used because
-Werror was already in CFLAGS and AC_TRY_COMPILE doesn't produce
main() functions with valid strict prototypes.  Suck.  But even
fixing that, the WiMAX SDK won't build with the flag, so just rip
it out.
2011-04-26 13:55:52 -05:00
Dan Williams
df511f74f7 build: use -Wundef and fix up cases where stuff wasn't defined (bgo #647157) 2011-04-14 13:19:12 -05:00
Dan Williams
398993e2f4 build: turn off set-but-not-used variable warnings in new GCC 2011-01-24 15:57:33 -06:00
Michael Biebl
dbd85915f1 Split compiler warnings into separate m4 macro file
The m4 macro is called NM_COMPILER_WARNINGS. Being in a separate file
makes it easier reusable for the other NM projects.
2009-05-02 18:01:13 -04:00