diff options
author | pfg <pfg@FreeBSD.org> | 2014-01-31 03:30:09 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-01-31 03:30:09 +0000 |
commit | 0d230789fc8f0ee3f6866cb5fa0a2d6f360b3bed (patch) | |
tree | 7d7536eae1eff885028eb7dfbd50b10faadf36ef /contrib | |
parent | 52026292841dcb3e20552b80608b3ee02137790e (diff) | |
download | FreeBSD-src-0d230789fc8f0ee3f6866cb5fa0a2d6f360b3bed.zip FreeBSD-src-0d230789fc8f0ee3f6866cb5fa0a2d6f360b3bed.tar.gz |
MFC r261178:
gcc: Add support for -Wmissing-prototypes in C++
Support for warnings about missing prototypes in C++ was added by Apple
GCC (Radar 6261539). Most of the code crept into r260311 so it felt
natural to make use of it.
Obtained from: Apple GCC - 5646
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/gcc/c.opt | 4 | ||||
-rw-r--r-- | contrib/gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | contrib/gcc/doc/invoke.texi | 8 |
3 files changed, 13 insertions, 3 deletions
diff --git a/contrib/gcc/c.opt b/contrib/gcc/c.opt index 37885bc..421e96e 100644 --- a/contrib/gcc/c.opt +++ b/contrib/gcc/c.opt @@ -280,9 +280,11 @@ Wmissing-include-dirs C ObjC C++ ObjC++ Warn about user-specified include directories that do not exist +; APPLE LOCAL begin warn missing prototype 6261539 Wmissing-prototypes -C ObjC Var(warn_missing_prototypes) +C ObjC C++ ObjC++ Var(warn_missing_prototypes) Warn about global functions without prototypes +; APPLE LOCAL end warn missing prototype 6261539 ; APPLE LOCAL begin -Wmost Wmost diff --git a/contrib/gcc/cp/decl.c b/contrib/gcc/cp/decl.c index 9a58994..877c053 100644 --- a/contrib/gcc/cp/decl.c +++ b/contrib/gcc/cp/decl.c @@ -11486,6 +11486,10 @@ start_function (cp_decl_specifier_seq *declspecs, gcc_assert (same_type_p (TREE_TYPE (TREE_TYPE (decl1)), integer_type_node)); + /* APPLE LOCAL begin warn missing prototype 6261539 */ + check_missing_prototype (decl1); + /* APPLE LOCAL end warn missing prototype 6261539 */ + start_preparsed_function (decl1, attrs, /*flags=*/SF_DEFAULT); return 1; diff --git a/contrib/gcc/doc/invoke.texi b/contrib/gcc/doc/invoke.texi index 0eaf2e3..4779bbd 100644 --- a/contrib/gcc/doc/invoke.texi +++ b/contrib/gcc/doc/invoke.texi @@ -225,6 +225,8 @@ in the following sections. -Wmain -Wmissing-braces -Wmissing-field-initializers @gol -Wmissing-format-attribute -Wmissing-include-dirs @gol -Wmissing-noreturn @gol +@c APPLE LOCAL warn missing prototype 6261539 +-Wmissing-prototypes @gol @c APPLE LOCAL -Wmost -Wmost (APPLE ONLY) @gol -Wno-multichar -Wnonnull -Wno-overflow @gol @@ -245,7 +247,8 @@ in the following sections. @item C-only Warning Options @gccoptlist{-Wbad-function-cast -Wmissing-declarations @gol --Wmissing-prototypes -Wnested-externs -Wold-style-definition @gol +@c APPLE LOCAL warn missing prototype 6261539 +-Wnested-externs -Wold-style-definition @gol -Wstrict-prototypes -Wtraditional @gol -Wdeclaration-after-statement -Wpointer-sign} @@ -3052,7 +3055,8 @@ types.) Warn if an old-style function definition is used. A warning is given even if there is a previous prototype. -@item -Wmissing-prototypes @r{(C only)} +@c APPLE LOCAL warn missing prototype 6261539 +@item -Wmissing-prototypes @opindex Wmissing-prototypes Warn if a global function is defined without a previous prototype declaration. This warning is issued even if the definition itself |