[C PATCH] PR43651: add warning for duplicate qualifier
Mikhail Maltsev
maltsevm@gmail.com
Sat Apr 9 12:29:00 GMT 2016
On 04/08/2016 08:54 PM, Martin Sebor wrote:
>> The name for new option "-Wduplicate-decl-specifier" and wording was
>> chosen to match the same option in Clang.
>
> My version of Clang also warns in C++ mode but if I'm reading
> the patch right, GCC would warn only C mode. I would find it
> surprising if GCC provided the same option as Clang but didn't
> make it available in the same languages. Do you have some
> reason for leaving it out that I'm not thinking of?
It is an error in C++ mode. Do we want to change this behavior?
>
> Also, in C11 mode, Clang issues the warning for duplicated
> _Atomic qualifiers but it doesn't look like GCC would with
> the patch. Here again, unless there's some reason not to,
> I would expect GCC to issue the same warning as Clang for
> the same code.
>
Fixed.
--
Regards,
Mikhail Maltsev
gcc/c/ChangeLog:
2016-04-08 Mikhail Maltsev <maltsevm@gmail.com>
PR c/43651
* c-decl.c (declspecs_add_qual): Warn when -Wduplicate-decl-specifier
is enabled.
* c-errors.c (pedwarn_c90): Return true if warned.
* c-tree.h (pedwarn_c90): Change return type to bool.
(enum c_declspec_word): Add new enumerator cdw_atomic.
gcc/ChangeLog:
2016-04-08 Mikhail Maltsev <maltsevm@gmail.com>
PR c/43651
* doc/invoke.texi (Wduplicate-decl-specifier): Document new option.
gcc/testsuite/ChangeLog:
2016-04-08 Mikhail Maltsev <maltsevm@gmail.com>
PR c/43651
* gcc.dg/Wduplicate-decl-specifier-c11.c: New test.
* gcc.dg/Wduplicate-decl-specifier.c: Likewise.
gcc/c-family/ChangeLog:
2016-04-08 Mikhail Maltsev <maltsevm@gmail.com>
PR c/43651
* c.opt (Wduplicate-decl-specifier): New option.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr43651-v3.patch
Type: text/x-patch
Size: 8223 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160409/dcdac4fd/attachment.bin>
More information about the Gcc-patches
mailing list