From: Andre Noll Date: Sun, 17 Jul 2016 16:27:13 +0000 (+0200) Subject: build: Combine $(CFLAGS) and $(STRICT_CFLAGS). X-Git-Tag: v0.6.0~2^2~9 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=16e6f52a4a9bba6ea98c1c06abfb28582bab9184;p=paraslash.git build: Combine $(CFLAGS) and $(STRICT_CFLAGS). We used to compile the parsers generated by gengetopt with less strict flags to avoid warnings in generated files. With lopsub this is no longer necessary, so one set of flags suffices. Moreover, we currently initialize $(STRICT_CFLAGS) to $(CFLAGS) (from the environment), then append our own flags. This is unfortunate because the user defined settings in $(CFLAGS) are overwritten. This patch changes the Makefile to only set STRICT_CFLAGS. We now pass $(STRICT_CFLAGS) $(CFLAGS) to the compiler, allowing the user to override (parts of) $(STRICT_CFLAGS) by adding -Wno-foo to CFLAGS. We use the opportunity to regroup the various options a little. --- diff --git a/Makefile.real b/Makefile.real index 3192bf1e..4ef8b2be 100644 --- a/Makefile.real +++ b/Makefile.real @@ -108,21 +108,18 @@ CPPFLAGS += -I/usr/local/include CPPFLAGS += -I$(lls_suite_dir) CPPFLAGS += $(lopsub_cppflags) -CFLAGS += -Os -CFLAGS += -Wuninitialized -CFLAGS += -Wchar-subscripts -CFLAGS += -Werror-implicit-function-declaration -CFLAGS += -Wmissing-noreturn -CFLAGS += -Wbad-function-cast -CFLAGS += -fno-strict-aliasing - -STRICT_CFLAGS = $(CFLAGS) -STRICT_CFLAGS += -g -Wundef -W +STRICT_CFLAGS += -fno-strict-aliasing +STRICT_CFLAGS += -g +STRICT_CFLAGS += -Os +STRICT_CFLAGS += -Wundef -W -Wuninitialized +STRICT_CFLAGS += -Wchar-subscripts +STRICT_CFLAGS += -Werror-implicit-function-declaration +STRICT_CFLAGS += -Wmissing-noreturn +STRICT_CFLAGS += -Wbad-function-cast STRICT_CFLAGS += -Wredundant-decls STRICT_CFLAGS += -Wno-sign-compare -Wno-unknown-pragmas -STRICT_CFLAGS += -Wformat -Wformat-security -STRICT_CFLAGS += -Wmissing-format-attribute STRICT_CFLAGS += -Wdeclaration-after-statement +STRICT_CFLAGS += -Wformat -Wformat-security -Wmissing-format-attribute LDFLAGS += $(clock_gettime_ldflags) @@ -249,7 +246,7 @@ $(object_dir)/compress_filter.o: CFLAGS += -O3 $(object_dir)/%.o: %.c | $(object_dir) @[ -z "$(Q)" ] || echo 'CC $<' $(Q) $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \ - $(STRICT_CFLAGS) $< + $(STRICT_CFLAGS) $(CFLAGS) $< # The compiler outputs dependencies either as foo.h or as some_directory/foo.h, # depending on whether the latter file exists. Since make needs the directory