From: <no...@so...> - 2003-01-03 01:18:37
|
Bugs item #661165, was opened at 2003-01-03 00:34 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=661165&group_id=2435 Category: gcc Group: 64 bit feature request Status: Open Resolution: None Priority: 5 Submitted By: Matt Ball (ballm) Assigned to: Danny Smith (dannysmith) Summary: printf function does not support long long Initial Comment: The printf function does not correctly handle long long input parameters in the MinGW environment (and possible other environments). The printf function appears to attempt to handle the long long input. However, it only pulls off one 32-bit parameter, and does not process the second 32-bit parameter for the long long. The next format descriptor will typically use the upper 32-bits of the previous long long parameter. Here is code that could repeat this problem: long long A = 12345678901234LL, B = 98765432109876LL; printf("%lld, %lld\n", A, B); GCC release: gcc (GCC) 3.2 (mingw special 20020817-1) Mingw release: MinGW 2.0.0-3 running under Windows NT ---------------------------------------------------------------------- >Comment By: Luke Dunstan (infidel) Date: 2003-01-03 09:19 Message: Logged In: YES user_id=30442 The C library that you are calling "libc" is the msvcrt.dll library provided my MS, so it is difficult to do anything to support "ll". Changing GCC's format checking would be easier but it is a fairly low priority at this stage, and I would guess that such a change may not be accepted for mainline GCC. ---------------------------------------------------------------------- Comment By: Matt Ball (ballm) Date: 2003-01-03 06:05 Message: Logged In: YES user_id=679162 Thanks for the info! The I64 approach will work for what I'm doing. However, there is still a descrepancy between gcc and libc. gcc does not appear to recognize the "I64" format specifier, and will issue a warning whenever C code includes it. The printf function in libc does not recognize the "ll" format prefix. However, gcc will not issue any warning if the C program uses "ll". In a future release we may want to resolve the differences in warnings issued by gcc, and what is implement for printf in libc. "ll" may be an ANSI C99 standard, so it might be worth implementing at some point. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2003-01-03 03:53 Message: Logged In: YES user_id=11494 MSVC printf does not recognize "ll" identifier, use "I64" instead. printf("%I64d, %I64d\n", A, B); Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=661165&group_id=2435 |