Skip to content

locator: Debug print Priority Source lock age as guint

Teemu Ikonen requested to merge tpikonen/geoclue:fix-uint-format into master

The CI output (like here) now has a compiler warning about format string type mismatch:

[49/88] Compiling C object src/geoclue.p/gclue-locator.c.o
In file included from /usr/include/glib-2.0/glib.h:64,
                 from /usr/include/glib-2.0/glib/gi18n.h:23,
                 from ../src/gclue-locator.c:27:
../src/gclue-locator.c: In function 'set_location':
../src/gclue-locator.c:156:31: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'guint64' {aka 'long long unsigned int'} [-Wformat=]
  156 |                      g_debug ("Priority Source Lock (age %lu) active, ignoring new %s location",
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  157 |                               new_timestamp - locator->priv->priority_source_lock_timestamp, src_name);
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                             |
      |                                             guint64 {aka long long unsigned int}
/usr/include/glib-2.0/glib/gmessages.h:362:32: note: in definition of macro 'g_debug'
  362 |                                __VA_ARGS__)
      |                                ^~~~~~~~~~~
../src/gclue-locator.c:156:60: note: format string is defined here
  156 |                      g_debug ("Priority Source Lock (age %lu) active, ignoring new %s location",
      |                                                          ~~^
      |                                                            |
      |                                                            long unsigned int
      |                                                          %llu

It looks like the CI has a 32-bit compiler, which is kind of surprising. Anyway, let's fix this.

Merge request reports

Loading