+
+
+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 ' ' '\012' |
+ 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
+