public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Mikhail Maltsev <maltsevm@gmail.com>,
	gcc-patches <gcc-patches@gnu.org>,
	Joseph Myers <joseph@codesourcery.com>,
	Marek Polacek <polacek@redhat.com>,
	David Malcolm <dmalcolm@redhat.com>
Subject: Re: [C PATCH] PR43651: add warning for duplicate qualifier
Date: Sun, 10 Apr 2016 20:12:00 -0000	[thread overview]
Message-ID: <570AB39C.1060002@gmail.com> (raw)
In-Reply-To: <5708F58A.7090701@gmail.com>

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


  reply	other threads:[~2016-04-10 20:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04 10:29 Mikhail Maltsev
2016-04-07 21:50 ` Joseph Myers
2016-04-08 11:42   ` Mikhail Maltsev
2016-04-08 17:55 ` Martin Sebor
2016-04-09 12:29   ` Mikhail Maltsev
2016-04-10 20:12     ` Martin Sebor [this message]
2016-04-28 12:00       ` [C PATCH PING] " Mikhail Maltsev
2016-05-10 20:10     ` [C PATCH] " Joseph Myers
2016-05-11 20:24       ` Mikhail Maltsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=570AB39C.1060002@gmail.com \
    --to=msebor@gmail.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=maltsevm@gmail.com \
    --cc=polacek@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).