Kode/kincmake

missing a way to specify compile as c or cpp or c11 in visual studio exporter

Closed this issue · 3 comments

c11 doesn't seem to work in visual studio.
I have some code with empty structs in c that only works if I set a standard supporting them or compile it as cpp code with the /TP flag (from file property in visual studio).
This should be supported and be specific to the project where the option is set as I may have other c files that I would not compile as cpp.

.c files are compiled as C, .cpp files are compiled as C++. Empty structs are disallowed in C11 (or more precisely, when you use them, behavior is undefined, see 6.7.2.1 in the C11 standard).

gnu99 allows empty structs - because that's a gnuc extension. You can't expect Visual Studio to replicate that.