public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "raeburn at raeburn dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/31887] bad warning converting qualified void* to qualified array pointer
Date: Fri, 11 May 2007 07:06:00 -0000	[thread overview]
Message-ID: <20070511070553.21040.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31887-11337@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from raeburn at raeburn dot org  2007-05-11 08:05 -------
Subject: Re:  bad warning converting qualified void* to qualified array pointer

On May 10, 2007, at 19:00, pinskia at gcc dot gnu dot org wrote:
> I think only "void*" can be done with an implicat cast so we go  
> from const
> void* to void* and then to const block*.

ISO/IEC 9899-1999 section 6.5.16.1 (assignment constraints) includes:

  - one operand is a pointer to an object or incomplete type and the  
other is a pointer to a qualified or unqualified version of void, and  
the type pointed to by the left has all the qualifiers of the type  
pointed to by the right.

So I'm pretty sure we don't automatically lose on the const-ness in  
the general case.  What I'm less sure about is how the array type  
plays into it.  According to 6.7.3, "const block" means "array [8] of  
const unsigned char", so is there an argument to be made that  
assigning a pointer-to-const value to an lvalue of type pointer to an  
unqualified array type (containing a type that happens to be const- 
qualified) isn't allowed?  I don't think it would be logical, but  
that doesn't guarantee that that's how the standard actually works.

Ken


-- 


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


  parent reply	other threads:[~2007-05-11  7:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10  4:43 [Bug c/31887] New: " raeburn at raeburn dot org
2007-05-10 23:00 ` [Bug c/31887] " pinskia at gcc dot gnu dot org
2007-05-11  7:06 ` raeburn at raeburn dot org [this message]
2007-08-15  6:03 ` raeburn at raeburn dot org
2008-11-17 12:25 ` bugs at 59A2 dot org
     [not found] <bug-31887-4@http.gcc.gnu.org/bugzilla/>
2014-02-26  2:03 ` pinskia at gcc dot gnu.org

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=20070511070553.21040.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).