This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31887] New: bad warning converting qualified void* to qualified array pointer
- From: "raeburn at raeburn dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 May 2007 04:43:32 -0000
- Subject: [Bug c/31887] New: bad warning converting qualified void* to qualified array pointer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
/* With revision 124583, using compiler command "./xgcc -B./ -O -S ~/qual.c"
in the "prev-gcc" directory once it's been updated with the current
binaries, the compiler complains:
qual.c:11: warning: passing argument 1 of 'foo' discards qualifiers from
pointer target type
*/
typedef unsigned char block[8];
extern int foo(const block *in, block *out);
int bar (const void *p, void *q) {
return foo (p, q); /* line 11 */
}
I'm not 100% sure about how array types and qualifiers mix, but I believe this
is correct code, and that there shouldn't be a warning.
--
Summary: bad warning converting qualified void* to qualified
array pointer
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: raeburn at raeburn dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31887