[Top][All Lists]

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

Bug report: sort.c or AIX compiler

From: Lemley James - jlemle
Subject: Bug report: sort.c or AIX compiler
Date: Wed, 5 Oct 2005 12:30:45 -0500

Hi Coreutils Coders, 

when compiling coreutils 5.90 on AIX 5.3 in 64 bit mode

sort dumps core at line 1724 or 1725 (coreutils 5.90).   

It works fine in 32-bit mode, and debugging statements I add make it
seem like the code is doing the right thing.  


Same thing is present in coreutils 5.30, and probably has been in sort.c
since it was written, but that's a wild guess.


When this change is made, it runs just fine (well, it works for at least
one input) after being compiled in 64-bit mode: 


<       bool swap = (0 < compare (&lines[-1], &lines[-2]));


>       int swap = (0 < compare (&lines[-1], &lines[-2]));


Perhaps the notion of doing arithmetic with negative numbers and a
"bool" data type is poor.  

When "swap" is cast as an int, as below: 

      temp[-2] = lines[-2 + (int) swap];

this also works fine; so it looks like the AIX compiler is not promoting
int + bool to int.  


So, change sort.c to not do math with a bool?  Or report to IBM as an
AIX compiler bug? 


--James Lemley




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]