https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110920

            Bug ID: 110920
           Summary: variably-length array declarations as parameters for C
                    compatibility
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: muecker at gwdg dot de
  Target Milestone: ---

g++ rejects variably length arrays in parameters because C++ does not have
this. This is a problem when including some C headers.

extern "C" {
extern void foo(int A, double matrix[A]);
extern void bar(int A, int B, double[A][B]);
}

g++ could simply parse and then ignore the parameter as a language extension. 

The first function 'foo' would then be directly usable form C++. For the second
function, there is no corresponding C++ type, but accepting this declaration in
headers would still allow the use of other functions. One could also consider 
the possibility to allow calling this function from C++ code with a double*.

Reply via email to