Gcc compiler does not stop on first error

How to get gcc so as not to stop compiling after the first error. Is there a compiler flag that will do this?

Basically I want to remove the class, but I'm not sure how much of this will have an effect, so I want to determine how many classes will have problems if I, say, delete the class from the make file.

Is there a better way to determine this effect?

+7
source share
2 answers

Here's the GCC compiler option -Wfatal-errors to stop after the first error:

-Wfatal error
This option causes the compiler to abort the compilation on the first error, rather than trying to continue and print further error messages

You can also use -Werror if you want to treat warnings as errors so that you can catch any warning that may be generated when you delete your class.

+18
source

Is there a better way to determine this effect?

Use the refactoring support built into many IDEs. For example, with NetBeans, you can rename a class and view all affected places.

Without the IDE, you can rename the class / method / field, instead of deleting it and gradually, with a few compilation runs, change all the customs of the old name, where the compiler gives an error. Then grep for the new name.

+1
source

All Articles