What is the range of illegle memory addresses?

Peng Yu pengyu.ut@gmail.com
Tue May 18 15:55:02 GMT 2021


Hi,

NULL (0) is a commonly used value for an invalid memory address. I
also see -1 is used for an illegal memory address.

Besides those values, I'd suspect that other values that are close to
0 (both negatives and positives) won't appear in real programs.

Is there a limit on the safe range that can be assumed to not be used
by user level code as valid addresses?

-- 
Regards,
Peng


More information about the Gcc-help mailing list