aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>2008-03-09 17:43:10 +0000
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>2008-03-09 17:43:10 +0000
commit96c302a5d66c2746203004709ed9ccf2d466b256 (patch)
tree7f23b331be468dba5213edf15d3bceff29b22262 /contrib
parent6a12d95bb22d0dad7925cf950678ad8c5f2a55a0 (diff)
gcc/
* c.opt (Wsynth): Deprecate. * doc/invoke.texi (Option Summary, Warning Options): Document -Wno-format-contains-nul. gcc/fortran/ * invoke.texi (Error and Warning Options): Document -Wline-truncation. contrib/ * check_warning_flags.sh: Instead of invoke.texi, take the path to the doc directory as argument. Check that warnings listed in 'gcc --help' are accepted by the compiler, and listed in the manuals. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@133059 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog7
-rwxr-xr-xcontrib/check_warning_flags.sh45
2 files changed, 50 insertions, 2 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 15656b99652..3f897e8e84a 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * check_warning_flags.sh: Instead of invoke.texi, take the path
+ to the doc directory as argument. Check that warnings listed in
+ 'gcc --help' are accepted by the compiler, and listed in the
+ manuals.
+
2008-03-06 Tom Tromey <tromey@redhat.com>
* patch_tester.sh (usage): Watermark is not lexicographic.
diff --git a/contrib/check_warning_flags.sh b/contrib/check_warning_flags.sh
index 95640f7758d..fcd0f37e105 100755
--- a/contrib/check_warning_flags.sh
+++ b/contrib/check_warning_flags.sh
@@ -18,7 +18,7 @@
progname=`echo "$0" | sed 's,.*/,,'`
usage ()
{
- echo "usage: $progname path/to/invoke.texi"
+ echo "usage: $progname path/to/gcc/doc"
echo "set \$CC to the compiler to be checked"
exit 1
}
@@ -28,7 +28,8 @@ LC_ALL=C
export LC_ALL
: ${CC=gcc}
test $# = 1 || usage
-invoke_texi=$1
+gcc_docdir=$1
+invoke_texi=$gcc_docdir/invoke.texi
test -r "$invoke_texi" || {
echo "$progname: error: cannot read '$invoke_texi'" >&2
usage
@@ -133,4 +134,44 @@ for lang in c c++ objc obj-c++; do
}
rm -f $file $filebase.o $filebase.obj $stderr
done
+
+
+remove_problematic_help_flags='
+ /^W$/d
+ /^W[alp]$/d
+ /^Werror-implicit-function-declaration$/d
+ /^Wsynth$/d
+ /-$/d
+ /=/d'
+help_flags=`
+ $CC --help -v 2>/dev/null | tr ' ' '\n' |
+ sed -n '
+ b a
+ :a
+ s/^-\(W[^<,]*\).*/\1/
+ t x
+ d
+ :x
+ '"$remove_problematic_help_flags"'
+ p' | sort -u`
+: >$filebase.c
+for flag in $help_flags; do
+ $CC -c $filebase.c -$flag 2>/dev/null || {
+ echo "warning -$flag not supported" >&2
+ ret=1
+ }
+ grep "@item.*$flag" $gcc_docdir/../*/*.texi >/dev/null || {
+ # For @item, we are satisfied with either -Wfoo or -Wno-foo.
+ inverted_flag=`echo "$flag" | sed '
+ s/^Wno-/W/
+ t
+ s/^W/Wno-/'`
+ grep "@item.*$inverted_flag" $gcc_docdir/../*/*.texi >/dev/null || {
+ echo "warning -$flag not documented in $gcc_docdir/../*/*.texi" >&2
+ ret=1
+ }
+ }
+done
+rm -f $filebase.c $filebase.o
+
exit $ret