This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Testresults of libffi-3.0.9rc10 for x64 mingw target


On 12/28/2009 07:15 PM, Kai Tietz wrote:
> 2009/12/28 Timothy Wall <twall@users.sf.net>:
>>
>> On Dec 28, 2009, at 12:50 PM, Andrew Haley wrote:
>>
>>> On 12/28/2009 05:16 PM, Anthony Green wrote:
>>>>
>>>> It looks like the failures are related to printing long long types.
>>>>
>>>> Andrew - do you remember the origin of this addition to ffitest.h...
>>>
>>> Yes.  See http://sourceware.org/ml/libffi-discuss/2009/msg00159.html
>>>
>>> Summary: mingw64 can't printf a long long.  According
>>> to Timothy Wall, "PRId64" is supposed to work on mingw64.
>>
>> I don't think "PRId64" is supposed to be in quotes, since it's a macro, but
>> I can't test atm.
> 
> Indeed, PRId64 is a macro and has not to be quoted, as otherwise it
> simply gets a string, which isn't the intention here.

This use of quotes looks perfectly alright to me.  What do you think
is supposed to be wrong with it?  The error messages suggest that
there is some problem interpreting the printf specifier.

Andrew.



Index: testsuite/libffi.call/ffitest.h
===================================================================
RCS file: /cvs/libffi/libffi/testsuite/libffi.call/ffitest.h,v
retrieving revision 1.5
diff -u -r1.5 ffitest.h
--- testsuite/libffi.call/ffitest.h	22 Dec 2008 15:21:15 -0000	1.5
+++ testsuite/libffi.call/ffitest.h	16 Jun 2009 09:37:58 -0000
@@ -45,6 +45,15 @@

 #endif

+/* MinGW kludge.  */
+#ifdef WIN64
+#define PRIdLL "PRId64"
+#define PRIuLL "PRIu64"
+#else
+#define PRIdLL "lld"
+#define PRIuLL "llu"
+#endif
+
 #ifdef USING_MMAP
 static inline void *
 allocate_mmap (size_t size)

-- testsuite/libffi.call/cls_align_uint64.c	11 Jun 2009 14:27:28 -0000	1.4
+++ testsuite/libffi.call/cls_align_uint64.c	12 Jun 2009 14:15:30 -0000
@@ -23,7 +23,7 @@
   result.b = a1.b + a2.b;
   result.c = a1.c + a2.c;

-  printf("%d %" PRId64 " %d %d %" PRId64 " %d: %d %" PRId64 " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+  printf("%d %llu %d %d %llu %d: %d %llu %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]