tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] wrong preprocessor shift operation


From: grischka
Subject: Re: [Tinycc-devel] wrong preprocessor shift operation
Date: Tue, 30 Dec 2008 15:35:11 +0100
User-agent: Thunderbird 2.0.0.18 (X11/20081125)

Christian Jullien wrote:
I think you're right.
Bug occurs when int (0xffffffff) is promoted to long long
(0xffffffffffffffff). Then right shift and back to int conversion returns a
false result.
Another possible fix is to cast to (unsigned int) as with

if (t1 == VT_LLONG) {
   l1 = v1->c.ll;
} else {
   l1 = (unsigned int)v1->c.i;
}

For my test case it works but will probably break many things.

As professional software developer I know how long it takes to test
everything after a fix. This fix can break many things and I don't want
(have to time) to become a TinyCC maintainer.

I think that long long computation/promotion should only occur when type is
declared as long long.

I let you decide how you want to address this bug.

Well, then thanks for reporting.  I pushed a fix on the mob branch.
http://repo.or.cz/w/tinycc.git?a=commitdiff;h=1fe4008fa3472ad0ae23f3901b64f9995a08952d




reply via email to

[Prev in Thread] Current Thread [Next in Thread]