Reply to post:

You've seen things people wouldn't believe – so tell us your programming horrors

Paul Smith

This 'bug' in some C code cost me some sleepless nights:

#define ONE 1

#define TWO ONE + 1

#define THREE TWO + 1

What would you expect THREE minus TWO to equal? If you thought ONE, you would be wrong. THREE minus TWO equals THREE!

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