Possible Duplicate:
“C subset of C++” -> Where not ? examples?
I am aware that C is a subset of C++ (i.e. there does not exist valid C code that is not valid C++ code). My question is whether g++
is completely compatible with all C code. For example, will
g++ -o testing test.c
produce an identical binary to
gcc -o testing test.c
in all circumstances?
More specifically, if they do not always create identical binaries, is there any reason that that could be a problem? Is it safe to always use g++
if I'm not sure about the code?
C is not a subset of C++.
Try:
foo.c
int main() {
int class = 0;
return 0;
}
Anyway have fun here: Where is C not a subset of C++?
It's hard to figure out how to answer this:
void*
is another.g++
(which version?) Or with -ansi
? -pedantic
? How about std=<lang>
?Given all this ambiguity, it's impossible to give you a definitive answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With