missing a way to specify compile as c or cpp or c11 in visual studio exporter
Closed this issue · 3 comments
Paolo-Oliverio commented
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.
RobDangerous commented
.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).
Paolo-Oliverio commented
Compile as c and as cpp is a legit option in visual studio and makes the
lib I'm using compile (chipmunk).As for c standard chipmunk specifies gnu99
that at this point I suppose it's ok with empty structs or more permissive
than c11 or whatever standard visual studio uses by default.
Il mer 11 nov 2020, 19:50 Robert Konrad <notifications@github.com> ha
scritto:
… .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).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#104 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSR75LRE2BWPPAJNW3UPOTSPLMINANCNFSM4TSGYMXQ>
.
RobDangerous commented
gnu99 allows empty structs - because that's a gnuc extension. You can't expect Visual Studio to replicate that.