diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-01-08 00:58:14 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-01-08 00:58:14 -0800 |
commit | fbcda3e712dba7486589966684ade2a3f1395ca9 (patch) | |
tree | f5ec575d4a6adb05ecc35bfadb1b3e81f3838f62 | |
parent | ed449d1077bdc00622d0b485c7e062f2a1b4e197 (diff) | |
download | txr-fbcda3e712dba7486589966684ade2a3f1395ca9.tar.gz txr-fbcda3e712dba7486589966684ade2a3f1395ca9.tar.bz2 txr-fbcda3e712dba7486589966684ade2a3f1395ca9.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.
-rwxr-xr-x | configure | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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! |