[Top][All Lists]

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

Re: [PATCH] Use 'return' from main() instead of calling exit()

From: Petter Reinholdtsen
Subject: Re: [PATCH] Use 'return' from main() instead of calling exit()
Date: Sun, 24 Oct 2004 23:42:26 +0200
User-agent: Mutt/1.4.1i

[James Youngman]
> I have made a similar change in the development code (which is
> available vai anonymous CVS).  My change also modifies the calling
> mechanism for usage() and doesn't use redundant parentheses with the
> return statement (I don't want to have a discussion of the relative
> merits of that though).

Sounds good. :)

>> It failed to compile on HP-UX 11.23 for ia64.  I'll get back to you
>> with patches for this one.
> OK.  It might be worth trying findutils 4.2.1 from
> ftp://alpha.gnu.org/gnu/findutils.

I tested.  This version fail on several archs (Solaris, RedHat EL AS
2.1, Irix, AIX) with error messages on find/parser.c similiar to this
(I picked the message from Irix, as it explains the problem very well :).

  cc-1241 cc: ERROR File = parser.c, Line = 1682
    A declaration cannot appear after an executable statement in a block.

      intmax_t val = ( (intmax_t)cur_day_start - num_days * DAYSECS

The problem is the definition of 'val' happening after statements.
This is not handled by several compiler versions, and was only added
in C99, if I remember correctly.

The compile on HP-UX 11.23 for ia64 still fail with this version.  The
problem seem to be a bug in the compiler, refusing code like this:

  static const char buf[] = ("string");

while it accept this code:

  static const char buf[] = "string";

This patch fixes that problem for version 4.1.20.  It is needed in
4.2.1 too.

diff -ur src-4.1.20/locate/locate.c src-4.1.20-local/locate/locate.c
--- src-4.1.20/locate/locate.c  2003-05-26 15:39:54.000000000 +0200
+++ src-4.1.20-local/locate/locate.c    2004-10-22 15:02:29.000000000 +0200
@@ -100,7 +100,10 @@
 #ifdef gettext_noop
 # define N_(String) gettext_noop (String)
-# define N_(String) (String)
+/* Removed () around String to work around a bug in the C compiler on
+   HP-UX 11.32.
+ */
+# define N_(String) String

 #include "locatedb.h"

reply via email to

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