On 20.10.2010 16:48, Ralf Mattes wrote:
> I think '!strcmp(' treats strcmp as returning a "generalized boolean" [1]
> 1 which it plain and simply isn't. It would have been nice if the ISO 
> standard would have restricted the return value to {-1,0,1} because then
> we could use enums/defines like FIRST_SMALLER, EQUAL  and SECOND_SMALLER 

You can still have those defines, but as macros around strcmp, not as
constants.

> but unfortunately the didn't (must have been that major performance boost
> you get from returning a[i] - b[i] ... :-)

Apparently you forget how fantastically good optimizing compilers were
back in the day when C first appeared. The standard just documents
existing practice, and it would've been major breakage if the standard
said something else than what compilers have been doing for 40 years ...

-- Brane

Reply via email to