Norbert Leister <> writes:
[...]
> I'm using gcc for normal compiling and running of my project (.h and
> .c files).
>
> But sometimes (only for the creation of warnings) I use the g++
> because it checks some missing type-casts and warns me if I switch the
> usage of booleans and enums (I've got some extended return
> values). The gcc does NOT recognises a
> return FALSE;
> when the function should return some enum. (gcc and g++ called with
> the same params)
>
> But I'm running only the gcc-compiled stuff.
The "missing type-casts" (BTW, the term is "casts", not "type-casts")
are probably ones that are required in C++ but not in C. g++ is
telling you things that are not relevant to C. (It will also print an
error message if you use "class" as an identifier, which is perfectly
legal in C.)
Using a C++ compiler to find additional errors in C code can make
sense *if* you realize which warnings are relevant and which are not.
You don't need to modify your code to eliminate *all* C++ diagnostics.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"