This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/7271: having problem with pointer to pointer with const in function calling
- From: reichelt at igpm dot rwth-aachen dot de
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, send2pradeep at yahoo dot com
- Date: 28 Nov 2002 23:18:21 -0000
- Subject: Re: c/7271: having problem with pointer to pointer with const in function calling
- Reply-to: reichelt at igpm dot rwth-aachen dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, send2pradeep at yahoo dot com, gcc-gnats at gcc dot gnu dot org
Synopsis: having problem with pointer to pointer with const in function calling
State-Changed-From-To: open->closed
State-Changed-By: reichelt
State-Changed-When: Thu Nov 28 15:18:20 2002
State-Changed-Why:
Not a bug in gcc.
For an explanation of the behaviour let's define the following types:
typedef int* X;
typedef const int* Y;
Then we declare two functions:
void func1(const int** p) == void func1(Y* p)
void func2(int* const* p) == void func2(const X* p)
With
int** i == X* i
it is okay to call func2 but not func1.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7271