Re: Warning using sprintf("%llu", uint64_t) on AMD64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tabris <tabris@xxxxxxxxxx> writes:

>  But then then suggests the
> question of how do I do an sprintf portably with 64-bit ints?

#include <inttypes.h>

 int64_t var;
 sprintf (buf, "%" PRId64, var);

>     Is there a [good] reason for this warning, and what should I do
> about it (even if the reason is bad, I need to silence the warning)

You can do something like the above.  Or you can add casts to the type
required by the format.  Or you can turn off the warning using
-Wno-format.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux