clear-sapp: non-trivial designated initializers not supported when used g++ MinGW compiler
Oldes opened this issue · 1 comments
Oldes commented
It looks that code like:
sokol-samples/sapp/clear-sapp.c
Lines 11 to 20 in 491415b
is not supported with MinGW g++ compiler:
g++.exe (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 7.2.0
sokol-samples\sapp\clear-sapp.c: In function 'void init()':
sokol-samples\sapp\clear-sapp.c:20:5: sorry, unimplemented: non-trivial designated initializers not supported
});
^
sokol-samples\sapp\clear-sapp.c:20:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:20:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:20:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:20:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:20:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:20:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:20:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:21:34: error: expected primary-expression before ')' token
pass_action = (sg_pass_action) {
^
sokol-samples\sapp\clear-sapp.c: In function 'sapp_desc sokol_main(int, char**)':
sokol-samples\sapp\clear-sapp.c:51:5: sorry, unimplemented: non-trivial designated initializers not supported
};
^
sokol-samples\sapp\clear-sapp.c:51:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:51:5: sorry, unimplemented: non-trivial designated initializers not supported
sokol-samples\sapp\clear-sapp.c:51:5: sorry, unimplemented: non-trivial designated initializers not supported
floooh commented
My guess is that the clear-sapp.c source file is compiled as C++, not as C (maybe g++ defaults to C++ also for files with the .c file extension). Before C++20, C++ doesn't support C99-style designated init, and C++20 only supports a subset. Compiling the file as C should fix that, also on gcc (it definitely works on Linux, also with fairly old gcc versions).