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

Geoff Keating geoffk@geoffk.org
Fri Aug 9 14:16:00 GMT 2002


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

From: Geoff Keating <geoffk@geoffk.org>
To: Nicolas Noble <nicolas@nobis-crew.org>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7562: strange behaviour with typedef and consts
Date: 09 Aug 2002 14:12:42 -0700

 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.
 
 -- 
 - Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>



More information about the Gcc-prs mailing list