diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-07-16 18:56:18 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-07-30 23:44:31 +0200 |
commit | 873b45d39c14fee6b68032b83ea6bfbc023e3379 (patch) | |
tree | 289a1fe87fe637c99fb0211dc554638663754220 /gcc/d | |
parent | dfc420f8d4492dbf5f45df4fecf93cb9645c0d7b (diff) | |
download | gcc-873b45d39c14fee6b68032b83ea6bfbc023e3379.zip gcc-873b45d39c14fee6b68032b83ea6bfbc023e3379.tar.gz gcc-873b45d39c14fee6b68032b83ea6bfbc023e3379.tar.bz2 |
d: Add -Wvarargs warning flag to the D front-end
The D front-end has C-style variadic functions and va_start/va_arg, so
it is right to also have warnings for inproper use.
gcc/d/ChangeLog:
PR d/96154
* gdc.texi (Warnings): Document -Wvarargs.
* lang.opt: Add -Wvarargs
gcc/testsuite/ChangeLog:
PR d/96154
* gdc.dg/pr96154a.d: New test.
* gdc.dg/pr96154b.d: New test.
Diffstat (limited to 'gcc/d')
-rw-r--r-- | gcc/d/gdc.texi | 6 | ||||
-rw-r--r-- | gcc/d/lang.opt | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/d/gdc.texi b/gcc/d/gdc.texi index 2ce560f..9bc1297 100644 --- a/gcc/d/gdc.texi +++ b/gcc/d/gdc.texi @@ -600,6 +600,12 @@ Warn when a @code{pragma()} is encountered that is not understood by where a pragma that is part of the D language, but not implemented by the compiler, won't get reported. +@item -Wno-varargs +@cindex Wvarargs +@cindex Wno-varargs +Do not warn upon questionable usage of the macros used to handle variable +arguments like @code{va_start}. + @item -fignore-unknown-pragmas @cindex @option{-fignore-unknown-pragmas} @cindex @option{-fno-ignore-unknown-pragmas} diff --git a/gcc/d/lang.opt b/gcc/d/lang.opt index e14c83d..ade92d2 100644 --- a/gcc/d/lang.opt +++ b/gcc/d/lang.opt @@ -146,6 +146,10 @@ Wunknown-pragmas D LangEnabledBy(D, Wall) ; Documented in C +Wvarargs +D +; Documented in C + X D Generate JSON file. |