The error output gcccan become very large. This is especially annoying when I use static statements and are not interested in any messages that appear after an unsuccessful statement.
gcc
Is it possible to limit the number of errors reported gcc?
While viewing the man page gccon -Wfatal-errors(see answer from @undur_gongor), I came across an option that directly answers my question:
-Wfatal-errors
-fmax-errors=n
It’s better to move stdoutit stderrto a file so that you don’t have an exit in the shell:
stdout
stderr
gcc file.c 1> compile.log 2>&1
, head, :
head
gcc test.c 2>&1 | head -n 5
grep:
grep
gcc test.c 2>&1 | grep "error"
does gcc stop compilation on the first error detected.
If you combine it with
-Werror
you can stop at the first warning.
Source: https://habr.com/ru/post/1617954/More articles:Updating multiple items with RESTful - restAllow const member function to edit some member variable using mutable - c ++How to document NodeJS native (V8) modules? - javascriptWhy use an owl: a restriction as its own: EquivalenceClass property? - semantic-webLaravel Intervention Image Class - Class 'Image' not found - laravel-5how to add multiple text images with image in edittext in android - androidЗапуск теста @Ignored JUnit в Eclipse - eclipseHow to run a Pregel Shortest Path by creating all vertices as the source vertex once on Spark Cluster - scalaAndroid - openCV, get part of an image - weird behavior - javagit cherry pick configuration - gitAll Articles