[Top][All Lists]

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

RE: Bug report: sort.c or AIX compiler

From: Lemley James - jlemle
Subject: RE: Bug report: sort.c or AIX compiler
Date: Thu, 6 Oct 2005 14:01:44 -0500

> So, the problem occurs only in a subscript context?  I really would
> like to catch it if possible.

Near as I can tell, that's right.  At least printf prints the right

> Does the following program catch it?  I'll looking for a way to detect
> that compiler bug at compile-time.

Just what you have listed won't compile on either AIX
(Integral constant expression with a value greater than zero is
 or gcc 2.96 (variable-size type declared outside of any function), but
this detects it:

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

I had to include stdio to get the definition of NULL.  Learn something
new every day...  I'm sure the constant string would work fine as well.

char is unsigned by default on this compiler. 

> Even so, we'd like coreutils to work fine on your system.  If it's a
> compiler bug that others have we don't want them to go through what
> you've gone through.  Are you using an experimental or a mainstream
> version of the compiler?  Maybe I was too hasty in backing out the
> sort.c change.

Mainstream, near as I can tell.  I can't guarantee there doesn't exist a
patch for this problem or newer version that we haven't applied, but
this is a brand-new IBM p-series box.  We may have the only one; I don't
know :)

 Smitty tells me:
 vac.C "C for AIX Compiler"
 xlC.cpp "C for AIX Preprocessor"

cc with no args prints: 
VisualAge C++ Professional / C for AIX Compiler, Version 6

uname -a prints: 
AIX happydb 3 5 00CB96ED4C00

OBJECT_MODE=64 to make 64-bit code by default.  When this is not set,
there is no problem.  

The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.

reply via email to

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