Richard W.M. Jones wrote:
On Fri, Nov 20, 2009 at 12:22:19PM +0100, Jim Meyering wrote:
> There's a new syntax check rule from gnulib.
> It requires that you write e.g., exit (EXIT_SUCCESS), not exit (0).
> And the same for 1/EXIT_FAILURE and any other constants.
Was there ever a platform where 0/1 weren't used for success or
failure? IIRC OS-9 was one such platform, but that was an indication
of fail in OS-9.
Anyway, I will push these patches shortly, with the exception of this
hunk:
@@ -10056,7 +10056,7 @@ public class Bindtests {
}
catch (Exception exn) {
System.err.println (exn);
- System.exit (1);
+ System.exit (EXIT_FAILURE);
Good catch.
That one will require either an exemption for the entire
src/generator.ml file (I'd rather not, considering how many
C exit stmts it emits), or an improved regexp in maint.mk that
would exempt all /\.exit/ uses. I'll look at doing that.
}
}
Rich.
PS.
http://coccinelle.lip6.fr/ is great for these sorts of semantic
transformations.
Yes, I've used coccinelle, too. Very nice tool.