This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/2478: [2003-04-13] problem with pointers to arrays and VLA
- From: Wolfgang Bangerth <bangerth at ices dot utexas dot edu>
- To: Giovanni Bajo <giovannibajo at libero dot it>
- Cc: gcc-gnats at gcc dot gnu dot org, <kengole at us dot ibm dot com>, <gcc-bugs at gcc dot gnu dot org>
- Date: Mon, 14 Apr 2003 08:35:11 -0500 (CDT)
- Subject: Re: c++/2478: [2003-04-13] problem with pointers to arrays and VLA
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2478
>
> Reconfirmed on 2.95 -> 3.4 20030413. Please bump date.
I think this is actually a problem with pointers to arrays and VLAs:
-------------------------
struct {
int (*p)[];
} B;
void foo() {
int (*p)[];
B.p=p;
}
-------------------------
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc: In function `void foo()':
x.cc:7: error: cannot convert `int (*)[]' to `int (*)[0]' in assignment
It compiles in C, but not in C++. I don't know whether it should.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth at ices dot utexas dot edu
www: http://www.ices.utexas.edu/~bangerth/