Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

Failed to parse explicit vararg declaration without other parameters

Open kant2002 opened this issue 2 years ago • 2 comments

void console_read(...);

Exception

typeof(Cesium.Core.ParseException): expected { while parsing compound_statement
expected ; while parsing ;
 but got OpenParen: (

kant2002 avatar Sep 27 '22 14:09 kant2002

Is it actually allowed, though? To me, the section 6.7.6 Declarators of the standard looks like it disallows single ... in the parameter list.

gcc 12.2 from godbolt.org confirms this:

<source>:3:10: error: ISO C requires a named argument before '...'
    3 | void foo(...);

ForNeVeR avatar Sep 28 '22 17:09 ForNeVeR

I think we could add much better error reporting for this case, but we shouldn't actually compile this code.

ForNeVeR avatar Sep 28 '22 17:09 ForNeVeR