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 privileged. 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. **************************************************************************
a.c
Description: a.c
_______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils