summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorBradley Sepos <[email protected]>2019-09-10 00:02:38 -0400
committerBradley Sepos <[email protected]>2019-09-10 12:06:30 -0400
commit53d6226c58e9f7bba23f1746bad1d8b61ec6338d (patch)
treecb71e4ab42f2f401aba160eeaf774d35786e4448 /make
parentbbc27a32048fe6631116e5c5e66d7eebca1b7070 (diff)
make: Check for -Wno-format-truncation in configure.py and record to GNUmakefile.
Makes clang shut up and can be used as a template to test whether the compiler supports other warnings.
Diffstat (limited to 'make')
-rw-r--r--make/configure.py12
-rw-r--r--make/include/gcc.defs2
2 files changed, 13 insertions, 1 deletions
diff --git a/make/configure.py b/make/configure.py
index 325328bf8..3dfba1106 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -1860,6 +1860,17 @@ int main()
strerror_r = LDProbe( 'strerror_r', '%s' % Tools.gcc.pathname, '', strerror_r_test )
strerror_r.run()
+ #########################################
+ ## Compiler option checks
+ #########################################
+ gcc_w_extra = []
+
+ Wno_format_truncation_command = '%s -O2 -Werror -Wno-format-truncation -S -o /dev/null -xc /dev/null > /dev/null 2>&1' % Tools.gcc.pathname
+ Wno_format_truncation = ShellProbe('checking for -Wno-format-truncation', '%s' % Wno_format_truncation_command)
+ Wno_format_truncation.run()
+ if Wno_format_truncation.fail is False:
+ gcc_w_extra.append('no-format-truncation')
+
## cfg hook before doc prep
cfg.doc_ready()
@@ -2030,6 +2041,7 @@ int main()
else:
doc.add( 'GCC.sysroot', '' )
doc.add( 'GCC.minver', '' )
+ doc.add( 'GCC.W.extra', " ".join(gcc_w_extra) )
if host_tuple.match( 'i?86-*' ):
doc.add( 'LIBHB.GCC.D', 'ARCH_X86_32', append=True )
diff --git a/make/include/gcc.defs b/make/include/gcc.defs
index f0baf3a96..d9aa6fdc3 100644
--- a/make/include/gcc.defs
+++ b/make/include/gcc.defs
@@ -8,7 +8,7 @@ GCC.c_std = 1
GCC.cxx_std = 0
GCC.ML = 1
GCC.H = 0
-GCC.W = all no-format-truncation
+GCC.W = all $(GCC.W.extra)
GCC.archs =
GCC.sysroot =
GCC.minver =