Another trap in ++

Bernie Cosell cosell at bbn-labs-b.ARPA
Sat Apr 13 05:18:26 AEST 1985


I realize this has been beaten to death, but there is a case that has
popped up often enough in code that I've had to debug that it clearly
seduces folk into forgetting that they're doing something slightly
off-color.  The situation pops up in cases like this:
   handle = hash (*p++, *p++);
Clearly the person thought they were doing something straightforward 
(after all, "*ptr++" is the `atomic' load-a-byte construct in C, right??)
whereas they were really playing with fire....

   /bernie



More information about the Comp.lang.c mailing list