This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/31679] Incorrect result of multiplication long long by 0xFFFFFFFFLL constant.



------- Comment #2 from vlasenko at bifit dot com dot ua  2007-04-24 13:16 -------
Yes, it compiles with warning... so what? The bug is not in the warning. If you
insert #include <stdio.h> in the top of source the bug reproduces and the
problem will not leave.
ÎÊ, if you want to play in bureaucracy, than here is a source that compiles
without warnings:

int __attribute__((__cdecl__)) printf (const char *, ...);

int main()
{
    long long qhat = 1;
    long long res = qhat * 0xffffffffLL;
    printf("res = %llx\n", res);
}

P.S. I simply didn't want to include the source of cygwin's stdio.h, to keep
things simplier for YOU.


-- 

vlasenko at bifit dot com dot ua changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]