<div dir="ltr"><div>sizeof operator returns size_t, which need not to be unsigned int, but can be long (long) unsigned int.<br>So here the correct fix should be either to use %zu (since C99) or cast it to unsigned long and use %lu<br><br></div><div>Regards,<br></div><div>Marek<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 20, 2015 at 1:28 AM, Bryce Harrington <span dir="ltr"><<a href="mailto:bryce@osg.samsung.com" target="_blank">bryce@osg.samsung.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Addresses this warning found by Denis Denisov:<br>
<br>
[src/logind-util.c:702]: (warning) %d in format string (no. 1)<br>
requires 'int' but the argument type is 'unsigned int'.<br>
<br>
Signed-off-by: Bryce Harrington <<a href="mailto:bryce@osg.samsung.com">bryce@osg.samsung.com</a>><br>
---<br>
src/logind-util.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/logind-util.c b/src/logind-util.c<br>
index 5c95874..006a1ae 100644<br>
--- a/src/logind-util.c<br>
+++ b/src/logind-util.c<br>
@@ -702,7 +702,7 @@ weston_logind_setup_vt(struct weston_logind *wl)<br>
sigset_t mask;<br>
struct wl_event_loop *loop;<br>
<br>
- snprintf(buf, sizeof(buf), "/dev/tty%d", wl->vtnr);<br>
+ snprintf(buf, sizeof(buf), "/dev/tty%u", wl->vtnr);<br>
buf[sizeof(buf) - 1] = 0;<br>
<br>
wl->vt = open(buf, O_RDWR|O_CLOEXEC|O_NONBLOCK);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div>