From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8401 invoked by alias); 10 May 2007 04:43:44 -0000 Received: (qmail 8367 invoked by uid 48); 10 May 2007 04:43:32 -0000 Date: Thu, 10 May 2007 04:43:00 -0000 Subject: [Bug c/31887] New: bad warning converting qualified void* to qualified array pointer X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "raeburn at raeburn dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg00742.txt.bz2 /* 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