Menu ▾ ▴

#3016 Internal error when compiling array with function call in array declaration

closed-fixed
None
other
5
4 days ago
2020-06-06
No
char arr[f(d) ? 0 : 0];

Compiling this with sdcc test.c gives Internal error: validateLink failed in SPEC_SCLS(cexpr->etype) @ SDCCast.c:1858: expected SPECIFIER, got null-link. Tested with commit 11647.

Discussion

  • Christopher Bazley

    • assigned_to: Christopher Bazley
     
  • Christopher Bazley

    Exact original malformed array declaration gets source diagnostics, with no validateLink failure.
    See https://godbolt.org/z/xM9boKfff

    Making the sample declaration maximally valid yields the expected warning
    <source>:6: error 288: object of variable length array type not supported
    See https://godbolt.org/z/1cs5bcnaT

     
  • Christopher Bazley

    • status: open --> closed-fixed
     
  • Christopher Bazley

    Regression test added as [r17053]

     

    Related

    Commit: [r17053]


Log in to post a comment.