[Top][All Lists]

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

Re: Ignore error

From: David Boyce
Subject: Re: Ignore error
Date: Mon, 01 May 2006 12:15:35 -0400

At 11:56 AM 5/1/2006, Paul D. Smith wrote:
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.

But if, as the OP seems to imply, the compiler really does exit with a smaller nonzero code for warnings than for errors (e.g. warnings <100, errors >=100) it would be easier to handle that in a wrapper script, or even within the makefile itself. Bourne shell syntax for the latter would be something like

        $(CC) .... || test $? -lt 100

This will not even run the "test" if $(CC) exits with 0. You just have to make sure to keep it on one (virtual) line, potentially extended with a backslash if that fits your aesthetic sense better.

I assume there's equivalent cmd.exe syntax for the above but don't know it offhand. I know || works on Windows but don't know what the equivalent of "test" is.

-David Boyce

reply via email to

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