[Bug c/33859] New: Bogus "discards qualifiers" warning
terra at gnome dot org
gcc-bugzilla@gcc.gnu.org
Mon Oct 22 13:44:00 GMT 2007
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
More information about the Gcc-bugs
mailing list