bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug report: sort.c or AIX compiler


From: Paul Eggert
Subject: Re: Bug report: sort.c or AIX compiler
Date: Thu, 06 Oct 2005 13:06:26 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

"Lemley James - jlemle" <address@hidden> writes:

> this detects it:
>
>   #include <stdbool.h>
>   #include <stdio.h>  
>   char *c = NULL;
>   int main() 
>       { return &(c + 5)[-2 + (bool) 1] == &c[4] ? 0 : 1; }

Thanks.  We might use that if that's the best we can do, but I want
something that works at compile-time, so that cross-compilation works.

How about this program instead?  It should fail to compile with the
buggy AIX compiler, but it should compile successfully with non-buggy
compilers.

   #include <stdbool.h>
   char c[] = "0123456789";
   int x = 1 / (&(c + 5)[-2 + (bool) 1] == &c[4]);
   int main() { return !c || !x; }




reply via email to

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