help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ignore error


From: Paul D. Smith
Subject: Re: Ignore error
Date: Mon, 1 May 2006 11:56:24 -0400

%% "Leeuwesteijn,Joost" <address@hidden> writes:

  l> My compiler returns a non-zero exit code in case of errors but
  l> -also- in case of warnings, which causes by make to fail :-( In my
  l> other post I asked about gcc's stdout/stderr output but I'd also
  l> like to know if gcc returns a non-zero exit code in case of
  l> warnings-only.

GCC normally does not fail on warnings.  That means that by default it
only exits with non-0 if there is an error.

There is a flag to GCC: -Werror which, if specified, causes GCC to exit
with an error if any warnings were detected as well.

  l> I don't like my build to fail when there are only warnings.

Funny, I'm just the opposite :-).

I guess it depends on the quality of your compiler's warnings.

  l> I seem to be stuck now. I can't use ignore error, but the build
  l> fails when there's a single (possibly acceptable) warning.

  l> Any suggestions?

Get a better compiler?  This is a quality of implementation issue with
your compiler, ultimately.


Assuming this is not an option, the only thing I can suggest is wrapping
your compiler in a perl script or similar that watches the output and
massages the exit code appropriately (so that it's 0 unless an error is
detected).  This works best if your compiler has a regular output syntax
for reporting warnings and errors.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]