Pino Toscano
2015-Jan-19 15:20 UTC
[Libguestfs] [PATCH] gobject: fix printf conversion specifier
Use PRIu64 to correctly handle uint64_t. --- generator/gobject.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/gobject.ml b/generator/gobject.ml index 5deb87e..5b07edd 100644 --- a/generator/gobject.ml +++ b/generator/gobject.ml @@ -722,6 +722,7 @@ let generate_gobject_session_source () #include <stdint.h> #include <stdio.h> #include <string.h> + #include <inttypes.h> /* Error quark */ @@ -780,7 +781,7 @@ guestfs_session_event_from_guestfs_event (uint64_t event) pr " } - g_warning (\"guestfs_session_event_from_guestfs_event: invalid event %%lu\", + g_warning (\"guestfs_session_event_from_guestfs_event: invalid event %%\" PRIu64, event); return UINT32_MAX; } -- 1.9.3
Richard W.M. Jones
2015-Jan-19 19:06 UTC
Re: [Libguestfs] [PATCH] gobject: fix printf conversion specifier
On Mon, Jan 19, 2015 at 04:20:44PM +0100, Pino Toscano wrote:> Use PRIu64 to correctly handle uint64_t. > --- > generator/gobject.ml | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/generator/gobject.ml b/generator/gobject.ml > index 5deb87e..5b07edd 100644 > --- a/generator/gobject.ml > +++ b/generator/gobject.ml > @@ -722,6 +722,7 @@ let generate_gobject_session_source () > #include <stdint.h> > #include <stdio.h> > #include <string.h> > + #include <inttypes.h> > > /* Error quark */ > > @@ -780,7 +781,7 @@ guestfs_session_event_from_guestfs_event (uint64_t event) > pr " > } > > - g_warning (\"guestfs_session_event_from_guestfs_event: invalid event %%lu\", > + g_warning (\"guestfs_session_event_from_guestfs_event: invalid event %%\" PRIu64, > event); > return UINT32_MAX; > } > -- > 1.9.3Thanks - I have pushed this so I could get it into the 1.29.21 release. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Apparently Analagous Threads
- [PATCH 1/3] gobject: NFC generated code formatting fix
- [PATCH] Split gobject sources into 1 file per class
- [libldm 1/3] relax uuid, zlib version requirements
- [PATCH 1/2] gobject: Allow RConstOptString to return an error
- libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_string.c libswfdec/swfdec_bits.c