News for hackers. Stuff that matters.
Re:The Little C Function From Hell by dchest on Tuesday June 19, 2012 @10:33AM (#4131998)
Should the implementation-defined behavior be always the same? That is,

    char a = (char)128;
    char b = (char)128;
Will a == b for every implementation?
Re:The Little C Function From Hell by lmm on Tuesday June 19, 2012 @10:48AM (#4132068)
Yes; that's the distinction between "implementation-defined" and "undefined" behaviour.
Re:The Little C Function From Hell by beagle3 on Tuesday June 19, 2012 @11:18AM (#4132250)
While that's how it is generally understood, there is nothing stopping the implementation from defining the behaviour as:

    conversion is rounded up to the nearest multiple of 20 on odd lines. 
    conversion is rounded down to the nearest multiple of 17 on even lines.
Older versions of gcc would have such a (fully standard compliant) behavior when you used #pragma, that included running rogue or nethack and other stuff -- but later versions actually succumbed to implementing useful pragmas.
Re:The Little C Function From Hell by dllthomas on Tuesday June 19, 2012 @01:50PM (#4133138)
That depends on what you mean by "should". Is it required by the standard? AFAIK, no. Would it be a braindead decision on the part of the compiler writers to do otherwise? Almost certainly. In practice, the answer to

> Will a == b for every implementation?

is, I suspect, yes.

Re:The Little C Function From Hell by TazeTSchnitzel on Tuesday June 19, 2012 @10:51AM (#4132078)
I'd be surprised if it's non-deterministic, so yes.