Is ((void *) -1) a valid address?

0xffffffff is technically a valid address in a 32 bit environment but on most operating systems (Certainly Linux/Windows) will be in the reserved kernel part of the address space. That means that in user mode processes it’s safe to use it as a error code since no user mode allocation function would return this as a usable address.

Leave a Comment