LWN.net Logo

GCC and pointer overflows

GCC and pointer overflows

Posted Apr 16, 2008 22:33 UTC (Wed) by gravious (guest, #7662)
In reply to: GCC and pointer overflows by zooko
Parent article: GCC and pointer overflows

How about?

CLEAR_CARRY_FLAG // arch dep macro
temp=x+y
if (CARRY_FLAG_IS_SET) // arch dep macro
    naughty_naughty();

Surely an easy to find out if something WOULD_OVERFLOW is to perform the operation and check
if it DID_OVERFLOW :)


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds