Reply to post: Yes, but it may be one of the few cases of him being wrong

Linus Torvalds fires off angry 'compiler-masturbation' rant

Christian Berger

Yes, but it may be one of the few cases of him being wrong

There's a rather good argument that he's wrong. Essentially using the compiler built-in function is more efficient and in a way more readable as everybody understands what this code is about. (checking for an overflow)

Overflows are one of the hard parts of C(++/#) and even Java.

Here is the full argument by someone who professionally finds integer overflows:

http://blog.fefe.de/?ts=a8c95274 (In German of course, this is about computing after all)

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon