Re:Tell HN: C Experts Panel – Ask us anything about C
by JoeAltmaier on Thursday April 16, 2020 @10:25AM
(#22889667)
Hm. May be off-topic by now. Incrementing an int is going to work the same on the same hardware, forever. Nothing the compile has any say in.
[ Parent
| on HN ]
Re:Tell HN: C Experts Panel – Ask us anything about C
by flatfinger on Thursday April 16, 2020 @04:59PM
(#22893497)
If a compiler decides that it's going to process:
unsigned mul(unsigned short x, unsigned short y)
{ return x*y; }
in a way that causes calling code to behave in meaningless fashion if x would exceed INT_MAX/y [something gcc will sometimes actually do, by the way, with that exact function!], the hardware isn't going to have any say in that.