By default, demote warnings promoted to errors back to warnings.

This commit is contained in:
David Young
2020-02-25 12:02:07 -06:00
parent 626c60dec4
commit 0f32728f72
+19 -1
View File
@@ -17,6 +17,24 @@
# if the compiler is not GNU; otherwise 'cc_flags_set' is set to 'yes'
#
#
# For now, do not promote any warnings to errors.
#
PROMOTE_ERRORS_DFLT=no
#
# This filter rewrites -Werror= as -W, in that way demoting warnings
# promoted to errors back to warnings, if PROMOTE_ERRORS is no.
#
demote_errors()
{
if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then
sed 's,-Werror=,-W,g'
else
cat
fi
}
#
# Prepend `$srcdir/config/gnu-` to the filename suffix(es) given as
# subroutine argument(s), remove comments starting with # and ending
@@ -26,7 +44,7 @@
load_gcc_arguments()
{
set -- $(for arg; do
sed 's,#.*$,,' $srcdir/config/gnu-${arg}
sed 's,#.*$,,' $srcdir/config/gnu-${arg} | demote_errors
done)
IFS=' ' echo "$*"
}