[Bug target/40786] New: Windows %I32 format confusion

jsm28 at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Jul 17 15:59:00 GMT 2009


http://msdn.microsoft.com/en-us/library/tcxf1dw6(VS.71).aspx
says that the Windows %I32 printf formats take arguments of type __int32
or unsigned __int32.

config/i386/msformat-c.c defines these using FMT_LEN_l, i.e. type long.
It appears that MinGW uses long for __int32, but MinGW-W64 uses int
(despite long being 32-bit for Win64), and so the compiler should
distinguish between these cases - or, in this special case, allow both
types.  (I don't know what __int32 is with the MS compiler, for either
32-bit or 64-bit.)

The testcase gcc.dg/format/ms-format1.c passes an int value to this format,
and so fails.  sys_format.c passes a long value, and so passes.  Clearly
both should pass the same type.


-- 
           Summary: Windows %I32 format confusion
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org
GCC target triplet: *-*-mingw*


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



More information about the Gcc-bugs mailing list