public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/25880] improve message of warning for discarding qualifiers
Date: Wed, 08 Sep 2010 23:34:00 -0000	[thread overview]
Message-ID: <20100908233356.9017.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25880-5650@http.gcc.gnu.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]



------- Comment #6 from manu at gcc dot gnu dot org  2010-09-08 23:33 -------
(In reply to comment #5)
> The changes done in pp_c_cv_qualifiers print "�__attribute__((const))�"  or
> '"__attribute__((noreturn))"' for function pointer even if they are defined
> with 'const' or 'volatile' in the users code and this may be confusing for
> some.

This is on purpose. There is no way to internally differentiate between these
two cases[*], so one has to decide to print one or the other. We decided the
current approach for function pointers was clearer, because (1) one should
really use the attributes and not volatile/const (2) one can lookup the
attributes and find out what they mean and that they are equivalent to
volatile/const. I hope this answers your question. 

[*] GCC is very far from retaining such detailed source-level information and
no one is working on improving this for the foreseeable future.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rmansfield at qnx dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25880


      parent reply	other threads:[~2010-09-08 23:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-20 15:59 [Bug c/25880] New: suggestion: a special warning for discarding the ``const'' qualifier roland dot illig at gmx dot de
2006-01-20 16:00 ` [Bug c/25880] " roland dot illig at gmx dot de
2006-01-20 16:04 ` pinskia at gcc dot gnu dot org
2010-06-04 15:16 ` [Bug c/25880] improve message of warning for discarding qualifiers manu at gcc dot gnu dot org
2010-06-04 15:22 ` manu at gcc dot gnu dot org
2010-09-08 23:06 ` rmansfield at qnx dot com
2010-09-08 23:34 ` manu at gcc dot gnu dot org [this message]

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=20100908233356.9017.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).