LWN.net Logo

Sure, but then you deserve what you get...

Sure, but then you deserve what you get...

Posted May 25, 2011 10:14 UTC (Wed) by welinder (guest, #4699)
In reply to: Sure, but then you deserve what you get... by khim
Parent article: What Every C Programmer Should Know About Undefined Behavior #3/3

That piece of code does not invoke undefined behaviour unless
"int" is too small to hold whatever value things sum up to.

This program may also invoke undefined behaviour:

int main (int argc, char **argv) { return 65535+1; }


(Log in to post comments)

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