Please sign in to comment.
sys/util.h: helper macro to perform pointer difference
Some code casts pointers to ints in order to obtain their difference. The compiler complains on 64-bit targets as an int is not wide enough to hold a pointer. Let's introduce the PTR_DIFF() helper macro to applies the proper cast to pointers before performing a difference on them, and still return the result as an int which should be large enough in practice. Signed-off-by: Nicolas Pitre <email@example.com>
- Loading branch information...