git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] AIX 5.2 - bug with 1.6.2.1

From
Jeff King <peff@peff.net>
Date
Mar 31, 2009, 12:29 UTC
Message-ID
<20090331122923.GA7173@coredump.intra.peff.net>
In-Reply-To
<3930158b0903310520h1f421518ka67de5f7aad0690b@mail.gmail.com>
On Tue, Mar 31, 2009 at 02:20:17PM +0200, Pierre Poissinger wrote:
> >  #define IS_RUN_COMMAND_ERR(x) ((-x) > ERR_RUN_COMMAND_FORK)
> oops... works for me with
> #define IS_RUN_COMMAND_ERR(x) (-(x) > ERR_RUN_COMMAND_FORK)

Oops, it should actually be "-(x) >= ERR_RUN_COMMAND_FORK". But it shouldn't make a difference in your test, since x was '0' in your case.

Junio, I think this patch should take care of it.
-- >8 --
Subject: [PATCH] fix portability problem with IS_RUN_COMMAND_ERR

Some old versions of gcc don't seem to like us negating an enum constant. Let's work around it by negating the other half of the comparison instead.

Reported by Pierre Poissinger on gcc 2.9.
---
 run-command.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/run-command.h b/run-command.h
index 15e870a..e345502 100644
--- a/run-command.h
+++ b/run-command.h
@@ -10,7 +10,7 @@ enum {
 	ERR_RUN_COMMAND_WAITPID_SIGNAL,
 	ERR_RUN_COMMAND_WAITPID_NOEXIT,
 };
-#define IS_RUN_COMMAND_ERR(x) ((x) <= -ERR_RUN_COMMAND_FORK)
+#define IS_RUN_COMMAND_ERR(x) (-(x) >= ERR_RUN_COMMAND_FORK)
 
 struct child_process {
 	const char **argv;
-- 
1.6.2.1.591.geb450
Previous: Pierre PoissingerNext: Pierre Poissinger
Message 3 of 4 in “Re: [PATCH] AIX 5.2 - bug with 1.6.2.1”
  1. Jeff KingMar 31, 2009
  2. Pierre PoissingerMar 31, 2009
  3. Jeff KingMar 31, 2009
  4. Pierre PoissingerMar 31, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.