Makefile.inc: Enable Wold-style-declaration command option

Warn for obsolescent usages, according to the C Standard, in a
declaration. For example, warn if storage-class specifiers like static
are not the first things in a declaration.

Change-Id: Ida3fa59edb07e4105ef3cfb6a20cb29680699586
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71892
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
This commit is contained in:
Elyes Haouas 2023-01-14 14:10:57 +01:00 committed by Felix Singer
parent d74ee60f71
commit 3d883ba606
1 changed files with 1 additions and 0 deletions

View File

@ -498,6 +498,7 @@ CFLAGS_common += -Wdangling-else -Wmissing-include-dirs
CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
CFLAGS_common += -fstrict-aliasing -ffunction-sections -fdata-sections -fno-pie
ifeq ($(CONFIG_COMPILER_GCC),y)
CFLAGS_common += -Wold-style-declaration
# Don't add these GCC specific flags when running scan-build
ifeq ($(CCC_ANALYZER_OUTPUT_FORMAT),)
CFLAGS_common += -Wno-packed-not-aligned