News for hackers. Stuff that matters.
Re:C++ Hints by _kst_ on Monday August 24, 2015 @03:20PM (#10112360)
The advice about storing pointers in integers:

http://cpphints.com/hints/7

is poor. It points out that converting a pointer value to "unsigned long" so you can perform arithmetic on it is a bad idea -- which is perfectly correct. But it advises just using a different integer type, such as "uintptr_t". The correct solution is to use pointer arithmetic. Don't store pointers in integers, store pointers in pointers; that's what they're for.

I've sent a comment to the author.

Re:C++ Hints by w0000t on Tuesday August 25, 2015 @06:55AM (#10115558)
Yep, C doesn't define that uintptr_t can be modified and converted back to a pointer. It is only for storage.
Re:C++ Hints by w0000t on Thursday August 27, 2015 @05:30PM (#10132245)
.