During the last two months, I spent a lot of time trying to remove the
following warnings of my package randtoolbox:
congruRand.c:180:3: warning: ISO C does not support the 'I64' ms_scanf length
sscanf(params, "%" PRIu64 "\n", &inp_mod);
The warning is raised by the option -pedantic added when checking the package
by R-devel. This warning is due to the use of the macro PRIu64. Note that this
warning does not show up when I use PRIu64 with printf via Rprintf in other
parts of the file congruRand.c.
My first reaction to look at
https://msdn.microsoft.com/fr-fr/library/f9ezhzhs(v=vs.110).aspx is useless,
because R on windows uses Mingw-W64 integer types and not the MS version.
Then, I tried to find information in such as Write Portable Code by Brian Hook
and C11 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf).
They do recommend to use the macro SCNu64 (reserved for scanf family) rather
than PRIu64 reserved for printf family functions.
Unfortunately when I check the package with R-devel, I still have the warning.
On GitHub, there are a version of mingw64 sources :
https://github.com/Alexpux/mingw-w64/ . It is explicitly written that SCNu64 is
I64u, see line 210 of
So, I was wondering if this warning was removable at all? Does anyone encounter
Any help is appreciated.
Thanks in advance, Christophe
PS: latest version of randtoolbox source code is here
CEREMADE, Univ. Paris Dauphine, France
Web : http://dutangc.free.fr
Rfirstname.lastname@example.org mailing list