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 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 PR c/43651 * doc/invoke.texi (Wduplicate-decl-specifier): Document new option. gcc/testsuite/ChangeLog: 2016-04-08 Mikhail Maltsev 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 PR c/43651 * c.opt (Wduplicate-decl-specifier): New option.