Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc compiler not stop on first error

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

Basically I'm wanting to remove a class, but i'm not sure how much of an impact that will have, so i'm wanting to determine how many classes would have provblems if i, say, remove the class from the makefile.

Is there a better way to determine this impact?

like image 541
shadonar Avatar asked Nov 21 '12 16:11

shadonar


People also ask

How do I turn off warning GCC?

To answer your question about disabling specific warnings in GCC, you can enable specific warnings in GCC with -Wxxxx and disable them with -Wno-xxxx. From the GCC Warning Options: You can request many specific warnings with options beginning -W , for example -Wimplicit to request warnings on implicit declarations.

How long does it take for GCC to compile?

You typically don't want to mess the system's default GCC because other packages may depend on the default version. Depending on the speed of your computer the build phase could take from about 30 minutes to a few hours.

What causes compiler error?

A compile error happens when the compiler reports something wrong with your program, and does not produce a machine-language translation. You will get compile errors.

What is GCC error?

The name of the assembler program with gcc is just as . So the error message tells you, that running the assembler fails, because the assembler executable contains an illegal instruction. This might really be an hardware error, meaning that the executable of the assembler is broken.


1 Answers

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

-Wfatal-errors
This option causes the compiler to abort compilation on the first error occurred rather than trying to keep going and printing further error messages

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

like image 142
P.P Avatar answered Oct 11 '22 16:10

P.P