This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/31887] New: bad warning converting qualified void* to qualified array pointer


/* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]