Sparse will warn on casts removing the address space of a pointer if the destination type is not unsigned long. But uintptr_t is better suited for this. So: 1) allow uintptr_t in such casts 2) add in the man page an explanation about the warnings, given or not given, for such casts. Changes since v1: * also allow uintptr * add an explanation of the logic, thanks to Linus. Luc Van Oostenryck (2): also accept casts of AS pointers to uintptr_t man: explain role of uintptr_t & unsigned long in casts from AS pointers evaluate.c | 2 +- sparse.1 | 13 +++++++-- validation/cast-from-as.c | 60 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 validation/cast-from-as.c -- 2.21.0