A. Lloyd Flanagan
Perhaps, but the statement was that it wasn't "safe" to compile C codeThere are a number of ways to write code which is valid C (i.e. C-89)
but illegal C++:
with a C++ compiler. In almost every case you mentioned, the
construct in C is _disallowed_ by the C++ compiler. In the other
case, the compiler will allocate more memory than required, but that's
usually harmless. So it's still "safe" in the sense that if C++
compiles the code it should work correctly.
As for whether the resulting program is faster, slower, or
indistinguishable from the program produced by the C compiler, that's
entirely a function of the compiler. The C++ spec has a design goal
that no feature imposes a runtime penalty if it's never used in the
program; a decent compiler will skip all the overhead required for
C++-specific features if you don't use them.
I'd take a good C++ compiler over a mediocre C compiler in every case.
Of course, if your C++ compiler creates a 2 MB program to print
"hello, world", that's not a good compiler.