------- Comment #2 from tomfelker at gmail dot com  2006-02-19 02:20 -------
OK, -fwrapv fixes it.  But what if I do this, shouldn't it work as I expect? 
(It doesn't without -fwrapv.)  Also, what is the safe way to do what I want?

int min = INT_MAX, i;
for(i = 1; i > 0; ++i) {
        int candidate = (i * i) & 0xffffffff;
        if((candidate < min) && (candidate > 0)) {
                min = candidate;
        }
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26358

Reply via email to