[PATCH] Document arithmetic overflow semantics
Joseph S. Myers
jsm28@cam.ac.uk
Fri Feb 14 19:37:00 GMT 2003
On Fri, 14 Feb 2003, Fergus Henderson wrote:
> Even for C, it might make sense to have a compilation option in which
> C operations were mapped to "op dont_care" rather than "op undef".
> This would be useful for compiling security-critical software.
> Perhaps it should even be the default.
I think we should recommend using "op trap" for security-critical
software. There is more runtime cost, but if an overflow does occur and
isn't trapped it is very likely to be an exploitable security hole.
--
Joseph S. Myers
jsm28@cam.ac.uk
More information about the Gcc
mailing list