summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-01-08 00:58:14 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-01-08 00:58:14 -0800
commit8dba0e5d2ea2c27384b1ee818c57fa41288acf1b (patch)
treef5ec575d4a6adb05ecc35bfadb1b3e81f3838f62 /configure
parent12fd1d7637c2fe5a4a6361aeb0f23997880cf1e2 (diff)
downloadtxr-8dba0e5d2ea2c27384b1ee818c57fa41288acf1b.tar.gz
txr-8dba0e5d2ea2c27384b1ee818c57fa41288acf1b.tar.bz2
txr-8dba0e5d2ea2c27384b1ee818c57fa41288acf1b.zip
gcc: disable annoying code quoting.
Newer versions of gcc add a lot of aggravating spewage to the diagnostics, by including copies of the lines of code where the error occurs followed by a line showing the error location with a caret and some tilde underlining. * configure: new test to see whether the compiler emits a caret line for a program that has a syntax error (missing closing brace). If so, we test whether the compiler accepts the option -fno-diagnostics-show-caret, and if so, we add that option to DIAG_FLAGS in config.make.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure27
1 files changed, 27 insertions, 0 deletions
diff --git a/configure b/configure
index d157c5b2..a621a9f8 100755
--- a/configure
+++ b/configure
@@ -908,6 +908,33 @@ else
printf " n/a\n"
fi
+printf "Checking for disabling source code quoting in compiler errors ... "
+
+cat > conftest.c <<!
+#include <stdio.h>
+int main(void)
+{
+!
+
+if ! conftest && grep -q -E '^ +\^' conftest.err ; then
+ cat > conftest.c <<!
+#include <stdio.h>
+int main(void)
+{
+return 0;
+}
+!
+ opt=-fno-diagnostics-show-caret
+ if conftest EXTRA_FLAGS=$opt ; then
+ printf "needed\n"
+ diag_flags="$diag_flags $opt"
+ else
+ printf "unable\n"
+ fi
+else
+ printf "no need\n"
+fi
+
#
# Check for annoying clashes from non-conforming BSD-derived systems that don't
# honor Unix/POSIX feature selection macros!