This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]