[PATCH util-macros 6/6] Add additional flags to XORG_COMPILER_FLAGS
Jeremy Huddleston
jeremyhu at apple.com
Tue Nov 1 13:16:24 PDT 2011
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
---
xorg-macros.m4.in | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index a2bf35c..f9d633e 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -1427,6 +1427,7 @@ else
BASE_CFLAGS=""
fi
+dnl This chunk of warnings were those that existed in the legacy CWARNFLAGS
XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wall)
XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wpointer-arith)
XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wstrict-prototypes)
@@ -1438,6 +1439,39 @@ XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wformat=2, -Wformat)
XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wold-style-definition)
XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wdeclaration-after-statement)
+dnl This chunk adds additional warnings that could catch undesired effects.
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wunused)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wuninitialized)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wshadow)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wcast-qual)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wmissing-noreturn)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wmissing-format-attribute)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wredundant-decls)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Winline)
+
+dnl These are currently disabled because they are noisy. They will be enabled
+dnl in the future once the codebase is sufficiently modernized to silence
+dnl them. For now, I don't want them to drown out the other warnings.
+dnl XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wlogical-op)
+dnl XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wparentheses)
+dnl XORG_TESTSET_CFLAG(BASE_CFLAGS, -Wcast-align)
+
+dnl Turn some warnings into errors, so we don't accidently get successful builds
+dnl when there are problems that should be fixed.
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=implicit)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=nonnull)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=init-self)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=main)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=missing-braces)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=sequence-point)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=return-type)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=trigraphs)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=array-bounds)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=write-strings)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=address)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=int-to-pointer-cast)
+XORG_TESTSET_CFLAG(BASE_CFLAGS, -Werror=pointer-to-int-cast)
+
AC_SUBST(BASE_CFLAGS)
]) # XORG_COMPILER_FLAGS
--
1.7.7
More information about the xorg-devel
mailing list