From fb4e461bad4c2423f7c7377d06d0e18fe7b45553 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 30 Apr 2012 03:18:52 +0200 Subject: [PATCH] Use -Werror for flags checking. Use -g3 for the new small macros. --- bin/errs12 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/errs12 b/bin/errs12 index a679861..4970709 100755 --- a/bin/errs12 +++ b/bin/errs12 @@ -12,7 +12,12 @@ customm="-m64" target= targets= configure="./configure" -debug="-ggdb2" +# >=4.7 has small macros section. +if gcc --version|perl -ne 'exit(!(/(\d+)\.(\d+)/&&($1>4||($1==4&&$2>=7))));';then + debug="-g3" +else + debug="-g2" +fi ldflags="-lmcheck" fast=false readline="" @@ -119,7 +124,10 @@ rm -f errs1.ok echo >&2 "flags error" exit 1 fi - "$CC" $flags -c errs1.c -o /dev/null && break + # Use -Werror: + # cc1: warnings being treated as errors + # archive.c:1: error: -fstack-protector not supported for this target + "$CC" $flags -Werror -c errs1.c -o /dev/null && break done if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then flags="$customm $flags" -- 1.8.3.1