This is the mail archive of the gcc-help@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]

VLA parameters


Reading the gcc 5.1 manual it seems that VLA parameters must be accepted by
g++. For example the following is fine when compiled with gcc --std=gnu11

///////////////////////////////////
float sum (int M, float x[M]) {
  return x[0] + x[1];
}

int main (void) {
  float xs[2] = {1, 2};
  float acc = sum (2, xs);
  return 0;
}
/////////////////////////////////

But it is rejected by g++ --std=gnu++11.

Is this possible at all with g++? Thanks.

--shiv--



--
View this message in context: http://gcc.1065356.n5.nabble.com/VLA-parameters-tp1163574.html
Sent from the gcc - Help mailing list archive at Nabble.com.


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