diff options
author | Dodji Seketeli <dodji@redhat.com> | 2012-04-30 11:43:57 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2012-04-30 13:43:57 +0200 |
commit | b9c8da345cd0763bb30a5a12713c808d74a2070f (patch) | |
tree | e79bab429f035c8a49182501433c80c03c767993 /gcc/c-family/c.opt | |
parent | 51fce2d3968d485cc72fb22740e82d0c31ce9ae9 (diff) | |
download | gcc-b9c8da345cd0763bb30a5a12713c808d74a2070f.zip gcc-b9c8da345cd0763bb30a5a12713c808d74a2070f.tar.gz gcc-b9c8da345cd0763bb30a5a12713c808d74a2070f.tar.bz2 |
Add -Wvarargs option
Several warnings related to questionable usage cases of variadic
function related macros (like va_start) could not be controlled by any
warning-related macro. Fixed thus, by introducing the -Wvarargs
option.
Tested on x86_64-unknown-linux-gnu against trunk.
gcc/c-family/
* c.opt (Wvarargs): Define new option.
gcc/
* builtins.c (fold_builtin_next_arg): Use OPT_Wvarargs as an
argument for the various warning_at calls.
gcc/doc/
* invoke.texi: Update the documentation.
gcc/testsuite/
* c-c++-common/Wvarargs.c: New test case.
* c-c++-common/Wvarargs-2.c: Likewise.
From-SVN: r186978
Diffstat (limited to 'gcc/c-family/c.opt')
-rw-r--r-- | gcc/c-family/c.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index ff8ce94..d2cf6ee 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -689,6 +689,10 @@ Wvariadic-macros C ObjC C++ ObjC++ Warning Do not warn about using variadic macros when -pedantic +Wvarargs +C ObjC C++ ObjC++ Warning Var(warn_varargs) Init(1) +Warn about questionable usage of the macros used to retrieve variable arguments + Wvla C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning Warn if a variable length array is used |