Brian Gladman wrote:
On 02/04/2014 22:49, leif wrote:
Brian Gladman wrote:
On 02/04/2014 19:57, Bill Hart wrote:
I have recently made quite a few changes to format specifiers in test
code, so I hope this is all still ok on Windows. If not, please let me
know. I didn't fix this problem permanently, which I think will involve
adding some new format specifiers to gmp_printf and using it instead of
printf, since MSVC doesn't support the c99 format specifiers. But this
can wait until the next release.
Or perhaps there is a way to make recent MSVC accept C99 format
specifiers for uintmax_t, intmax_t and size_t and a workaround for %ld
vs %lld.
As of Visual Studio 2013 it does :-)
VS 2013 has gone a long way towaards C99 and C++ 11. See the links
below if you are interested in the details:
http://msdn.microsoft.com/en-us/library/hh409293.aspx
http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx
http://msdn.microsoft.com/en-us/library/hh567368.aspx
Of course this is not much help if we want to continue support for
previous versions :-(
Why don't you just use the macros (PRI...) from inttypes.h, and,
depending on HAVE_INTTYPES_H and/or the MSVC version, define the few you
need yourself?
(Or did I miss something?)
No, you didn't!
My problem is that (a) the issue is only about 24 hours old (Bill raised
it, I think, yesterday), (b) inttypes.h is completely new to me as it
has only been available in Visual Studio for a few months, and (c) until
Bill raised it, I didn't even know that I should take any interest in it!
Well, their use looks pretty ugly, or is a bit tedious to type (IMHO);
instead of e.g.
#if ... /* long long is 64 bits, long is only 32 bits */
printf("%lld\n", bigval);
#else /* long is already 64 bits */
printf("%ld\n", bigval);
#endif
you'd write
printf("%"PRId64"\n", bigval);
I.e., PRId64 expands just to a string containing the appropriate format
specifier (not including the percent sign, such that one can also write
things like "%20"PRId64 etc.).
But you'd "only" have to modify the test code I think.
But if Bill wants to use inttypes.h, we can certainly use it in VS 2013
and do what you suggest for earlier versions. There are also earlier
non-Microsoft versions of this header that we could use on these versions.
On *nix, 'configure' already checks for inttypes.h (and config.h defines
HAVE_INTTYPES_H accordingly).
-leif
--
() The ASCII Ribbon Campaign
/\ Help Cure HTML E-Mail
--
You received this message because you are subscribed to the Google Groups
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.