[Issue 22104] New: importC: Parser accepts arrays with incomplete element types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 6 00:09:14 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22104

          Issue ID: 22104
           Summary: importC: Parser accepts arrays with incomplete element
                    types
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

This is wrong code in C, but dmd CParser accepts it as valid.
---
int array1[][4];  // NG: Requires explicit initializer

int array2[4][];  // NG: Incomplete element type.
                  //     Multidimensional array must have bounds for all
                  //     dimensions except the first.

int testfn(int p[4][]); // NG: Incomplete element type.
                        // Proper way to "complete" type is to use `[*]`
---

--


More information about the Digitalmars-d-bugs mailing list