News for hackers. Stuff that matters.
Re:C Traps and Pitfalls (1988) [pdf] by SloopJon on Friday June 19, 2015 @07:21PM (#9748256)
The book of the same name is a decent third book on C: K&R or some other intro, Expert C Programming, then this.
Re:C Traps and Pitfalls (1988) [pdf] by bch on Friday June 19, 2015 @07:31PM (#9748289)
> The book of the same name is a decent third book on C: K&R or some other intro, Expert C Programming, then this.

For the curious, this paper _is_ the the basis for the aforementioned book...

"This paper, greatly expanded, is the basis for the book C Traps and Pitfalls (Addison-Wesley, 1989, ISBN 0–201–17928–8); interested readers may wish to refer there as well."

Re:C Traps and Pitfalls (1988) [pdf] by McUsr on Friday June 19, 2015 @08:39PM (#9748461)
Andrew Koenig, the author of this paper/book, is also co-author of Accellerated C++, which I can whole heartedly recommend. [Addison Wesley ISBN-10: 0-201-70353-X]
Re:C Traps and Pitfalls (1988) [pdf] by mintisan on Friday June 19, 2015 @10:31PM (#9748717)
+32
Re:C Traps and Pitfalls (1988) [pdf] by ouah on Saturday June 20, 2015 @11:19AM (#9750168)
"Incidentally, it is a common misconception that if c is a character variable, one can obtain the unsigned integer equivalent of c by writing (unsigned) c. This fails because a char quantity is converted to int before any operator is applied to it, even a cast. Thus c is converted first to a signed integer and then to an unsigned integer, with possibly unexpected results."

The "even a cast" part is wrong. The usual arithmetic conversions (including the integer promotion) is not done with the cast operation in C.

Re:C Traps and Pitfalls (1988) [pdf] by mpu on Saturday June 20, 2015 @02:57AM (#9749246)
Lots of code in there is deprecated. Don't use it.
Re:C Traps and Pitfalls (1988) [pdf] by krylon on Saturday June 20, 2015 @03:40AM (#9749303)
Well, that is kind of to be expected, the paper is nearly thirty years old. It is still an interesting read, though, if one uses C a lot.

Some of the advice does seem odd to me, such as the warning regarding bitwise vs. logical operators.