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: PATCH libffi win64 support



On Jun 12, 2009, at 11:53 AM, Andrew Haley wrote:



I see that on 64-bit linux, PRId64 evaluates to "ld". "long int" is
the same size as "long long int", but gcc is still complaining. Can you
instead cast the "long long int" argument to int64_t or something to
remove the warning?

Hmm. I guess under the circumstances that's the right thing to do,
but it's pretty evil in a test case that's suppose to test long long.
Is the Windows library going to get fixed to accept %lld in the
forseeable future? If so, we could just xfail it until then.

It's not really a bug per se. It's a feature of the platform.

I suppose you could argue that a part of Standard C that is missing is just a feature of a platform rather than a bug, but I find that pretty hard to believe.

If the test case is testing a type that doesn't exist on a given
platform, maybe the proper thing to do is mark it UNSUPPORTED, as
opposed to XFAIL.

That's not the problem: it has the type but not the printf format specifier, or so it seems.

I don't think PRIdMAX would work either; on my linux it's mapped to the "ld" as well.


Since there's no PRIxxx defined that explicitly maps to long long, we could put one in ffitest.h and use that.
Something like:


#ifdef WIN64
#define PRIdLL PRId64
#define PRIuLL PRIu64
#else
#define PRIdLL lld
#define PRIuLL llu
#endif


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