On 04/09/2016 06:28 AM, Mikhail Maltsev wrote:
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?
You're right, G++ does give an error. I missed it in my testing.
Unlike C11, C++ requires a diagnostic for duplicated cv-qualifiers
so by issuing a warning Clang is more permissive. My personal
inclination would be to treat this consistently between C and C++
but whether or not to change it is something Jason would need to
weigh in on.
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.
Great, thank you.
Martin