Commit 0efbf18b authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

rts: Fix C compiler warnings on Windows

Summary:
Specifcally we want the MinGW compiler to use ISO print format
specfifiers.

Test Plan: Validate on Linux, OS X and Windows

Reviewers: Phyx, austin, bgamari, simonmar

Reviewed By: bgamari, simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2192
parent 584ade67
......@@ -21,6 +21,11 @@
#ifndef STGTYPES_H
#define STGTYPES_H
#if defined(mingw32_HOST_OS)
/* Inform mingw we want the ISO rather than Windows printf format specifiers. */
#define __USE_MINGW_ANSI_STDIO 1
#endif
/* ISO C 99 says:
* "C++ implementations should define these macros only when
* __STDC_LIMIT_MACROS is defined before <stdint.h> is included."
......
......@@ -3799,9 +3799,12 @@ ocVerifyImage_PEi386 ( ObjectCode* oc )
IF_DEBUG(linker, i=1);
if (i == 0) return 1;
debugBelch( "sectab offset = %" FMT_Int "\n", ((UChar*)sectab) - ((UChar*)hdr) );
debugBelch( "symtab offset = %" FMT_Int "\n", ((UChar*)symtab) - ((UChar*)hdr) );
debugBelch( "strtab offset = %" FMT_Int "\n", ((UChar*)strtab) - ((UChar*)hdr) );
debugBelch("sectab offset = %" FMT_SizeT "\n",
((UChar*)sectab) - ((UChar*)hdr) );
debugBelch("symtab offset = %" FMT_SizeT "\n",
((UChar*)symtab) - ((UChar*)hdr) );
debugBelch("strtab offset = %" FMT_SizeT "\n",
((UChar*)strtab) - ((UChar*)hdr) );
debugBelch("\n" );
debugBelch( "Machine: 0x%x\n", (UInt32)(hdr->Machine) );
......
......@@ -424,18 +424,19 @@ void traceCapsetEvent (EventTypeNum tag,
tracePreface();
switch (tag) {
case EVENT_CAPSET_CREATE: // (capset, capset_type)
debugBelch("created capset %" FMT_Word " of type %d\n", (W_)capset, (int)info);
debugBelch("created capset %" FMT_Word32 " of type %d\n", capset,
(int)info);
break;
case EVENT_CAPSET_DELETE: // (capset)
debugBelch("deleted capset %" FMT_Word "\n", (W_)capset);
debugBelch("deleted capset %" FMT_Word32 "\n", capset);
break;
case EVENT_CAPSET_ASSIGN_CAP: // (capset, capno)
debugBelch("assigned cap %" FMT_Word " to capset %" FMT_Word "\n",
(W_)info, (W_)capset);
debugBelch("assigned cap %" FMT_Word " to capset %" FMT_Word32 "\n",
info, capset);
break;
case EVENT_CAPSET_REMOVE_CAP: // (capset, capno)
debugBelch("removed cap %" FMT_Word " from capset %" FMT_Word "\n",
(W_)info, (W_)capset);
debugBelch("removed cap %" FMT_Word " from capset %" FMT_Word32
"\n", info, capset);
break;
}
RELEASE_LOCK(&trace_utx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment