3 ms·
I'm not very sure this is a good idea–what exactly is the benefit of allowing the creation of off-by-one pointers that you can't do anything with?
by saagarjha 6y ago
I'm not very sure this is a good idea–what exactly is the benefit of allowing the creation of off-by-one pointers that you can't do anything with?
- sanxiyn 6y agoMy motivation is to prevent accidental UB. Let p be array of length 10. Currently, p + 15 - 10 is UB so you must parenthesize p + (15 - 10). This seems preventable and unnecessary.