This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: 'const' with double indirection
- From: Andrew Haley <aph at gcc dot gnu dot org>
- To: "Jacob van der Woude" <jacobw at allieddata dot nl>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Thu, 12 Apr 2007 13:05:21 +0100
- Subject: Re: 'const' with double indirection
- References: <IPEDJCCFIDDGBCILCGMKEEOADMAA.jacobw@allieddata.nl>
Jacob van der Woude writes:
> I'm not sure if the following is a compiler issue or a language/standard
> misunderstandig my side.
> (And I hope that in general this all is understood, English is not my native
> language.)
cdecl> explain const int * const * const List
declare List as const pointer to const pointer to const int
cdecl> explain int * const * const List
declare List as const pointer to const pointer to int
So the question is whether these types are compatible. This can
easily be answered by reference to the standard:
6.7.3 Para 9: "For two qualified types to be compatible, both shall
have the identically qualified version of a compatible type; the order
of type qualifiers ... does not affect the specified type."
Andrew.