public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/33859]  New: Bogus "discards qualifiers" warning
@ 2007-10-22 13:44 terra at gnome dot org
  2007-10-22 15:37 ` [Bug c/33859] " rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: terra at gnome dot org @ 2007-10-22 13:44 UTC (permalink / raw)
  To: gcc-bugs

static void foo (char *s) { }
void bar (const char *s) { foo ((char *)s); }

gcc 4.2.0 produces this warning with -Wall -O2:
www.c:2: warning: passing argument 1 of `foo' discards qualifiers from pointer
target type.

Due to the cast, the argument already has the right type, so gcc should not
warn.
The warning disappears without -O2.
gcc 4.1.1 did not produce this warning.


-- 
           Summary: Bogus "discards qualifiers" warning
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: terra at gnome dot org
  GCC host triplet: i686-suse-linux


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/33859] Bogus "discards qualifiers" warning
  2007-10-22 13:44 [Bug c/33859] New: Bogus "discards qualifiers" warning terra at gnome dot org
@ 2007-10-22 15:37 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-10-22 15:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-10-22 15:36 -------


*** This bug has been marked as a duplicate of 29478 ***


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-22 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-22 13:44 [Bug c/33859] New: Bogus "discards qualifiers" warning terra at gnome dot org
2007-10-22 15:37 ` [Bug c/33859] " rguenth at gcc dot gnu dot org

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