Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit the number of error messages from `gcc`

Tags:

gcc

The error output of gcc can become very large. This is especially annoying when I am using static assertions and am not interested in any messages that come after the failed assertion.

Is it possible limit the number of errors reported by gcc?

like image 888
AlwaysLearning Avatar asked Feb 08 '23 10:02

AlwaysLearning


1 Answers

When looking up the gcc manual page on -Wfatal-errors (see the answer by @undur_gongor), I stumbled upon the option that directly answers my question:

-fmax-errors=n
like image 155
AlwaysLearning Avatar answered Jun 11 '23 11:06

AlwaysLearning