2009/11/29 Mark Dickinson <dickinsm@xxxxxxxxx>: > > This code is wrong, I think, because it depends on undefined > behaviour. I'm wondering how best to rewrite it so that (a) > the replacement code is correct and portable C89, and (b) > there's a reasonable chance of gcc compiling it to efficient > assembler on common platforms. > What about using (long)((unsigned long)a + (unsigned long)b) or something to get around the UB?