public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
Cc: <gcc@gcc.gnu.org>, <cfe-dev@lists.llvm.org>
Subject: Re: ISO C3X proposal: nonnull qualifier
Date: Thu, 2 Dec 2021 20:36:48 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2112022032570.144190@digraph.polyomino.org.uk> (raw)
In-Reply-To: <3178a917-e9df-36eb-4382-f8aec7b678a2@gmail.com>

On Thu, 2 Dec 2021, Alejandro Colomar (man-pages) via Gcc wrote:

> So, now this can be made non-flow-sensitive, which was a big concern. And now
> the biggest concern I can see is that this qualifier works opposite to const
> (here discarding is allowed but not adding it), and that is contrary to how

For all existing qualifiers, the rules about discarding are rules about 
permitted assignments (and conversions as if by assignment) between 
pointers and concern the qualifiers on pointer target types: 6.5.16.1 is 
the key subclause concerning implicit conversions, and any proposal for 
changes in that area needs to be precise about exactly what textual 
changes are proposed to 6.5.16.1.

> compilers have been working for now.  As far as I could read in the standard,
> there's no mention to qualifiers being dropped in an rvalue; Joseph, could you
> please confirm?  Also, as I already mentioned, Clang already implements this

lvalue-to-rvalue conversion drops qualifiers (and _Atomic).  "If the 
lvalue has qualified type, the value has the unqualified version of the 
type of the lvalue; additionally, if the lvalue has atomic type, the value 
has the non-atomic version of the type of the lvalue; otherwise, the value 
has the type of the lvalue." (6.3.2.1).

-- 
Joseph S. Myers
joseph@codesourcery.com

  parent reply	other threads:[~2021-12-02 20:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 16:01 Alejandro Colomar (man-pages)
2021-11-15 16:30 ` Alejandro Colomar (man-pages)
2021-11-15 20:18 ` Joseph Myers
2021-11-15 21:09   ` Alejandro Colomar (man-pages)
2021-11-15 22:17     ` Joseph Myers
2021-11-15 22:35       ` Alejandro Colomar (man-pages)
2021-11-15 22:47         ` Joseph Myers
2021-11-16 12:34           ` Alejandro Colomar (man-pages)
2021-11-17  0:06             ` Alejandro Colomar (man-pages)
2021-11-20 16:47               ` Ping: " Alejandro Colomar (man-pages)
2021-11-23 11:32               ` [cfe-dev] " Dmitri Gribenko
2021-11-23 11:17             ` Dmitri Gribenko
2021-11-23 11:45               ` Alejandro Colomar (man-pages)
2021-11-23 12:45                 ` Dmitri Gribenko
2021-12-01 22:24                   ` Alejandro Colomar (man-pages)
2021-12-02  0:39                     ` Dmitri Gribenko
2021-12-02  1:00                       ` Alejandro Colomar (man-pages)
2021-12-02 20:24             ` Alejandro Colomar (man-pages)
2021-12-02 20:31               ` Alejandro Colomar (man-pages)
2021-12-02 20:36               ` Joseph Myers [this message]
2021-11-16  9:30     ` Jonathan Wakely
2021-11-16 17:13       ` [cfe-dev] " Arthur O'Dwyer

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=alpine.DEB.2.22.394.2112022032570.144190@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=alx.manpages@gmail.com \
    --cc=cfe-dev@lists.llvm.org \
    --cc=gcc@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).