#1086 error with %lu in mingw-runtime-3.13-20070825-1

closed-fixed
nobody
2007-09-26
2007-09-22
Ozkan Sezer
No

If I use snprintf / vsnprintf in my code (not the msvcrt
underscore-prefixed versions), %l or %lu prints incorrect
numbers. I use this format (dwBufferBytes is DWORD):
("%lu bytes in sound buffer\n", (unsigned long)dsbcaps.dwBufferBytes)

With runtime 3.12 it reports 262144, but with the new
runtime-3.13-20070825-1 I get 67548840450064384 .

This looks like a problem with the C99 compatibility
added in the new version.

The full suit I use to compile my binaries is like this:

'Good' version:
gcc-core-3.4.5-20060117-1
gcc-g++-3.4.5-20060117-1
binutils-2.17.50-20070129-1
w32api-3.9
mingw-runtime-3.12
It is a cross compile toolchain I compiled, here are
links for the compiled versions:
http://heanet.dl.sourceforge.net/sourceforge/uhexen2/cross-tools-20070519.tgz
http://heanet.dl.sourceforge.net/sourceforge/uhexen2/cross-tools-20070519-src.tgz

Broken version:
gcc-core-3.4.5-20060117-1
gcc-g++-3.4.5-20060117-1
binutils-2.17.50-20070129-1
w32api-3.10
mingw-runtime-3.13-20070825-1
It is a cross compile toolchain I compiled, here are
links for the compiled versions:
http://heanet.dl.sourceforge.net/sourceforge/uhexen2/cross-tools-20070825.tgz
http://heanet.dl.sourceforge.net/sourceforge/uhexen2/cross-tools-20070825-src.tgz

If you need anything else, please tell me.

Ozkan

Discussion

  • Ozkan Sezer
    Ozkan Sezer
    2007-09-25

    • summary: error with %l in mingw-runtime-3.13-20070825-1 --> error with %lu in mingw-runtime-3.13-20070825-1
     
  • Ozkan Sezer
    Ozkan Sezer
    2007-09-25

    Logged In: YES
    user_id=219327
    Originator: YES

    it seems like I had some typoes in the bug report:
    %l should be %lu.

     
  • Keith Marshall
    Keith Marshall
    2007-09-25

    • status: open --> pending
     
  • Ozkan Sezer
    Ozkan Sezer
    2007-09-26

    • status: pending --> open
     
  • Ozkan Sezer
    Ozkan Sezer
    2007-09-26

    Logged In: YES
    user_id=219327
    Originator: YES

    Applying this patch and re-building the runtime 3.13-20070825-1
    seems to have fixed the problem. My logs now report correct numbers:

    --- debugded.log~
    +++ debugded.log
    -Programs occupy 5133824367968388004K.
    +Programs occupy 932K.

    Thanks.

     
  • Keith Marshall
    Keith Marshall
    2007-09-26

    Logged In: YES
    user_id=823908
    Originator: NO

    Thanks.

    This may be closed; the fix will be in the next release. Maybe another interim snapshot release would be appropriate. I'll withdraw the 20070825-1 snapshot.

     
  • Keith Marshall
    Keith Marshall
    2007-09-26

    • milestone: --> IINR_-_Include_In_Next_Release
    • status: open --> closed-fixed