[coreboot] Must-read for unsigned calculations

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Wed Oct 15 12:26:09 CEST 2008


Hi,

I read the paper below some years ago, but it is still valid and being
aware of the contents can help avoid some totally non-obvious mistakes.
http://www.fefe.de/intof.html
Especially for former ROMCC code which uses unsigned types heavily this
is a must read.
Please keep in mind that
if (a - b > c)
will not always do what you want if unsigned types are involved.

Regards,
Carl-Daniel




More information about the coreboot mailing list