Indicate 'exiting due to errors' if errors, not warnings.

This commit is contained in:
Wilson Snyder 2011-10-31 21:39:15 -04:00
parent 85a37ea53f
commit 7654add5e5
3 changed files with 12 additions and 5 deletions

View File

@ -10,6 +10,8 @@ indicates the contributor was also the author of the fix; Thanks!
**** Search for user -y paths before default current directory. [Ruben Diez] **** Search for user -y paths before default current directory. [Ruben Diez]
**** Indicate 'exiting due to errors' if errors, not warnings. [Ruben Diez]
**** Fix reporting not found modules if generate-off, bug403. [Jeremy Bennett] **** Fix reporting not found modules if generate-off, bug403. [Jeremy Bennett]

View File

@ -973,8 +973,8 @@ is an alias for GCC compatibility.
Verilator defaults to the current directory ("-y .") and any specified Verilator defaults to the current directory ("-y .") and any specified
--Mdir, though these default paths are used after any user specified --Mdir, though these default paths are used after any user specified
directories. This allows "-y `pwd`" to be used if absolute filenames are directories. This allows '-y "$(pwd)"' to be used if absolute filenames
desired for error messages instead of relative filenames. are desired for error messages instead of relative filenames.
=back =back

View File

@ -332,13 +332,18 @@ void V3Error::incErrors() {
void V3Error::abortIfErrors() { void V3Error::abortIfErrors() {
if (errorCount()) { if (errorCount()) {
v3fatal ("Exiting due to "<<dec<<errorOrWarnCount()<<" warning(s)\n"); abortIfWarnings();
} }
} }
void V3Error::abortIfWarnings() { void V3Error::abortIfWarnings() {
if (v3Global.opt.warnFatal() ? errorOrWarnCount() : errorCount()) { bool exwarn = v3Global.opt.warnFatal() && warnCount();
v3fatal ("Exiting due to "<<dec<<errorOrWarnCount()<<" warning(s)\n"); if (errorCount() && exwarn) {
v3fatal ("Exiting due to "<<dec<<errorCount()<<" error(s), "<<warnCount()<<" warning(s)\n");
} else if (errorCount()) {
v3fatal ("Exiting due to "<<dec<<errorCount()<<" error(s)\n");
} else if (exwarn) {
v3fatal ("Exiting due to "<<dec<<warnCount()<<" warning(s)\n");
} }
} }