The main difference is that (assuming the files are detected as C ++) g ++ sets the flags necessary for linking to the standard C ++ library. It can also configure exception handling. I would not rely on the fact that just because your application does not use a standard library that is not needed when compiling C ++ (for example, the default exception handler).
EDIT: As stated in the comments, you will have problems with any constructors (which work) for static objects, as well as without getting virtual function tables (so if you use these functions in C ++, you still need to link this library) .
EDIT2: If you are not using the special C99 code in your C project, I would simply switch to compiling everything, like C ++, as a first step in your migration process.
Mark b
source share