2 ms·
Yes in current C standard. As far as I know this is not necessary for optimizations and I want this to be fixed in the future C standard.
by sanxiyn 6y ago
Yes in current C standard. As far as I know this is not necessary for optimizations and I want this to be fixed in the future C standard.
- saagarjha 6y agoI'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.