[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 09:10:48 -0500

Paul, Jim and other interested parties:  
The problem isn't with bool or _Bool; the problem reproduces with char
and unsigned char as well.  Moreover, the assert won't catch it. 

Looks like a rather severe compiler bug to me.

Example program output: 

-2 + b is -1
-2 + b is -1
-2 + b is -1
&d[-2 + (int) b] is ffffffffffff658
&d[-2 + (char) b] is 10000000fffff658
&d[-2 + (bool) b] is 10000000fffff658

That's not index overflow.  That's off by A LOT.  

Summary:  don't do anything to sort.c or friends; this is a compiler
problem.   It may be debatable practice to do math with a bool assuming
the value of true is always 1, but in this case it doesn't look wrong.  

Thanks for listening.

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.

Attachment: a.c
Description: a.c

reply via email to

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