fschutt / azul

Desktop GUI Framework
https://azul.rs/
Mozilla Public License 2.0
5.87k stars 218 forks source link

C header fails to parse with clang #354

Open Beyley opened 1 year ago

Beyley commented 1 year ago

Description

Upon attempting to parse the C header for azul with clang, it fails with various errors

Version / OS

Steps to Reproduce

clang azul.h

Additional Information

azul.h:4064:18: error: expected expression
    AzFloatValue[;20] matrix;
                 ^
azul.h:4064:17: error: expected member name or ';' after declaration specifiers
    AzFloatValue[;20] matrix;
    ~~~~~~~~~~~~^
azul.h:4064:19: error: type name requires a specifier or qualifier
    AzFloatValue[;20] matrix;
                  ^
azul.h:4064:19: error: expected member name or ';' after declaration specifiers
azul.h:4064:19: error: expected ';' at end of declaration list
    AzFloatValue[;20] matrix;
                  ^
                  ;
azul.h:4064:21: error: type name requires a specifier or qualifier
    AzFloatValue[;20] matrix;
                    ^
azul.h:4064:21: error: expected member name or ';' after declaration specifiers
azul.h:4064:21: error: expected ';' at end of declaration list
    AzFloatValue[;20] matrix;
                    ^
                    ;
azul.h:6436:13: error: expected expression
    uint8_t[; 10] panose;
            ^
azul.h:6436:12: error: expected member name or ';' after declaration specifiers
    uint8_t[; 10] panose;
    ~~~~~~~^
azul.h:6436:15: error: type name requires a specifier or qualifier
    uint8_t[; 10] panose;
              ^
azul.h:6436:15: error: expected member name or ';' after declaration specifiers
azul.h:6436:14: error: expected ';' at end of declaration list
    uint8_t[; 10] panose;
             ^
             ;
azul.h:6436:17: error: type name requires a specifier or qualifier
    uint8_t[; 10] panose;
                ^
azul.h:6436:17: error: expected member name or ';' after declaration specifiers
azul.h:6436:17: error: expected ';' at end of declaration list
    uint8_t[; 10] panose;
                ^
                ;
azul.h:9725:1: error: use of 'AzMenuItem' with tag type that does not match previous declaration
union AzMenuItem {
^~~~~
struct
azul.h:6591:8: note: previous use is here
struct AzMenuItem;
       ^
azul.h:9730:9: error: use of 'AzMenuItem' with tag type that does not match previous declaration
typedef union AzMenuItem AzMenuItem;
        ^~~~~
        struct
azul.h:9725:7: note: previous use is here
union AzMenuItem {
      ^
azul.h:12376:46: error: 'void' must be the first and only parameter if specified
extern DLLIMPORT AzRefAny AzRefAny_newC(void ptr, size_t len, uint64_t type_id, AzString  type_name, AzRefAnyDestructorType  destructor);
                                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

(this error log taken from linux, but happens the same on windows too)