http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56652
--- Comment #5 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2013-03-18 12:33:50 UTC --- (In reply to comment #4) > (In reply to comment #2) > > Quick check with clang -fsanitize=undefined shows: > > ... > > numeric.cc:47:30: fatal error: negation of -2147483648 cannot be > > represented in > > type 'int'; cast to an unsigned type to negate this value to itself > > > > Thus invalid. > > Thank you. OK, works if I change type of count and size to unsigned. > So INT_MIN has wrong value? -INT_MIN is an integer overflow and is undefined behavior in C. http://www.google.com/search?hl=en&q=+INT_MIN