This is the mail archive of the gcc@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: Help restricting args of an intrinsic function


On Monday, February 2, 2004, at 04:35 PM, Daniel Jacobowitz wrote:
If you read Richard's reply, he says that will already work - in C++. In C,

  const int ci = 5;
  int a1[ci];

will not compile, because ci is not an integral constant-expression.

I know. But, one of the main reasons why we are introducing builtins is to be able to compile code from another compiler, Code Warrior. We are doing this so that users have an easy code migration. They allow it. Also, telling users that their code doesn't work in C, but works in C++ in this one case, is, uhm, pedantic.


Does anyone know why the above isn't supported in C? Certainly the obviousness of it escapes me. My inclination is to fix the standard, not the compiler.

If Syd is trying to make that work in C/ObjC, as opposed to C++, some
serious surgery may be involved.

I'm envisioning 6 lines of code. I can't fathom what could possible require major surgery.



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