summaryrefslogtreecommitdiff
path: root/gcc/c-family/c.opt
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-30 11:43:57 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-30 11:43:57 +0000
commit7edb10625104be0ca3dcce2ff1a29bf1e11bf047 (patch)
treee79bab429f035c8a49182501433c80c03c767993 /gcc/c-family/c.opt
parent611f1003dbf4ebb341c2eda0fcc0e058c421eb6b (diff)
downloadgcc-7edb10625104be0ca3dcce2ff1a29bf1e11bf047.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186978 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c.opt')
-rw-r--r--gcc/c-family/c.opt4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index ff8ce94f96c..d2cf6ee6caa 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