Viewing Issue Advanced Details Jump to Notes ] Wiki ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0008660 [DCSS] Patches minor have not tried 2014-06-08 10:08 2014-07-23 00:40
Reporter johnnyzero View Status public  
Assigned To neil
Priority normal Resolution done Local or Remote Local
Status closed   Operating System Windows
Projection none   Console or Tiles Both
ETA none Fixed in Branch 0.15 ancient branch Product Branch 0.15 ancient branch
  Product Version 0.15-a0-1347-gb0c9e78
Summary 0008660: AppHdr.h: Adjust PRINTF macro for use with mingw-w64
Description
AppHdr.h: Adjust PRINTF macro for use with mingw-w64

When __attribute__((format(printf...)) is used, as is the case with
AppHdr.h's PRINTF macro, mingw-w64 uses the standard windows printf
implementation by default.  The stdio library provided by windows is
typically *not* C99-compliant.  Since crawl uses C99-style PRINTF
calls, many warnings are printed during compilation.

This patch guarantees that, if available, a C99-style printf will
be used for both format checking and actual compiled calls under
mingw-w64.  If the C99-specific printf macro is not set by 
including stdio.h (e.g., mingw32 is being used), the standard printf
call for format is used.


Note: This patch is against git b0c9e7892796b91383c174755e9888fc75e8857d. Tested against i686-w64-mingw32 (cross-build) and x86_64-linux-gnu.
Steps To Reproduce
Additional Information
Tags No tags attached.
Attached Files ? file icon 0001-AppHdr.h-Adjust-PRINTF-macro-for-use-with-mingw-w64.patch [^] (2,732 bytes) 2014-06-08 10:08 [Show Content]
? file icon 0002-Makefile-Pass-the-correct-mingw-C99-stdio-define.patch [^] (875 bytes) 2014-06-08 22:35 [Show Content]
? file icon 0001-AppHdr.h-Remove-PRINTF-define-duplication-in-mingw-c.patch [^] (2,338 bytes) 2014-06-09 01:15 [Show Content]

- Relationships

-  Notes
(0026430)
johnnyzero (reporter)
2014-06-08 22:57

Additional tests were performed using an i686-pc-mingw32 cross-compile on Cygwin and i586-mingw32msvc cross-compile on Debian. Compilation is working as expected for both mingw-w64 and mingw32 cross-tools.

Note that both patches are necessary (an incorrect define was passed in via the Makefile with the first patch).
(0026431)
neil (administrator)
2014-06-08 23:49

In trunk (0.15-a0-1363-g87d8b17), thanks!
(0026432)
johnnyzero (reporter)
2014-06-09 01:21

Per feedback from SamB and |amethyst in ##crawl-dev, another patch has been attached:
Remove PRINTF #define duplication in mingw check.

Fix indentation, remove #define duplication, and correct a comment
about which macro must be defined for enabling mingw-w64's C99
printf.


Tested against Debian x86_64 native, i686-mingw-w64, and i586-mingw32msvc targets.

Accepted in trunk:
http://s-z.org/neil/git/?p=crawl.git;a=commit;h=6bdb4c3189a32750953b17b04ef45849a24ff4a2 [^]

- Issue History
Date Modified Username Field Change
2014-06-08 10:08 johnnyzero New Issue
2014-06-08 10:08 johnnyzero File Added: 0001-AppHdr.h-Adjust-PRINTF-macro-for-use-with-mingw-w64.patch
2014-06-08 22:35 johnnyzero File Added: 0002-Makefile-Pass-the-correct-mingw-C99-stdio-define.patch
2014-06-08 22:57 johnnyzero Note Added: 0026430
2014-06-08 23:49 neil Note Added: 0026431
2014-06-08 23:49 neil Status new => resolved
2014-06-08 23:49 neil Fixed in Branch => 0.15 development branch
2014-06-08 23:49 neil Resolution open => done
2014-06-08 23:49 neil Assigned To => neil
2014-06-09 01:15 johnnyzero File Added: 0001-AppHdr.h-Remove-PRINTF-define-duplication-in-mingw-c.patch
2014-06-09 01:21 johnnyzero Note Added: 0026432
2014-07-23 00:40 johnnyzero Status resolved => closed


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker