c++/7562: strange behaviour with typedef and consts

Nicolas Noble Pixel@the-babel-tower.nobis-crew.org
Fri Aug 9 14:51:00 GMT 2002


The following reply was made to PR c++/7562; it has been noted by GNATS.

From: Nicolas Noble <Pixel@the-babel-tower.nobis-crew.org>
To: Geoff Keating <geoffk@geoffk.org>
Cc: Nicolas Noble <nicolas@nobis-crew.org>,  <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/7562: strange behaviour with typedef and consts
Date: Fri, 9 Aug 2002 23:15:16 +0200 (CEST)

 > Nicolas Noble <nicolas@nobis-crew.org> writes:
 >
 > > typedef void * voidp;
 > >
 > > void func1(const voidp p) { }
 > >
 > > void func2(const void * p) {
 > >     func1(p);
 > > }
 >
 > 'const voidp p' is the same as 'void * const p', not 'const void * p'.
 > It is correct for the compiler to complain here.
 
 Yeah, I understand perfectly... even if said like that it *IS* clear, I
 was confused by the zlib.h header. I'll complain to Jean-Loup Gailly then
 to correct his code :-)
 
 Thanks a lot!
 
   -- Nicolas Noble
 



More information about the Gcc-prs mailing list