I have the following C code, which returns a value from a void function.
void foo() {
// do something
return 0;
}
int main() {
foo();
return 0;
}
Clearly this should not compile and Clang fails with an error. However, MSVC allows this with a warning: warning C4098: 'foo': 'void' function returning a value
I would like clang to behave as MSVC does. Is there a way to configure clang such that it will also allow this? I’ve tried clang-cl and the flag -fms-compatibility to no avail.
Thanks!
1