Warnings in XCB tutorial code

sandmanbig sandmanbig at gmail.com
Mon Jan 9 00:05:07 UTC 2017


Hi, thank for all your hard work and time. I've been learning XCB so I
can develop stuff and give back to the community,

However, at https://www.x.org/releases/X11R7.7/doc/libxcb/tutorial/index.html
I was trying the code provided in section 10.5 and I just wanted to
let you know that this code generates warnings. A previous section
did, too, but I changed to code to fix them. Anyway, I thought I
should let you guys know.

I'm not using html, so I can't format this, but here was my command:
shredder at technodrome ~/Documents/programming/XCB/xcb $ gcc -Wall -o
mouse-keyboard-events mouse-keyboard-events.c -lxcb

And then here was the output:mouse-keyboard-events.c: In function
‘print_modifiers’:
mouse-keyboard-events.c:17:7: warning: format not a string literal and
no format arguments [-Wformat-security]
       printf(*mod);
       ^
mouse-keyboard-events.c: In function ‘main’:
mouse-keyboard-events.c:69:15: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 2 has type ‘xcb_window_t’ [-Wformat=]
               ev->window, ev->x, ev->y, ev->width, ev->height);
               ^
mouse-keyboard-events.c:79:17: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 2 has type ‘xcb_window_t’ [-Wformat=]
                 ev->event, ev->event_x, ev->event_y);
                 ^
mouse-keyboard-events.c:83:17: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 2 has type ‘xcb_window_t’ [-Wformat=]
                 ev->event, ev->event_x, ev->event_y);
                 ^
mouse-keyboard-events.c:87:17: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 3 has type ‘xcb_window_t’ [-Wformat=]
                 ev->detail, ev->event, ev->event_x, ev->event_y);
                 ^
mouse-keyboard-events.c:96:15: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 3 has type ‘xcb_window_t’ [-Wformat=]
               ev->detail, ev->event, ev->event_x, ev->event_y);
               ^
mouse-keyboard-events.c:103:15: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 2 has type ‘xcb_window_t’ [-Wformat=]
               ev->event, ev->event_x, ev->event_y);
               ^
mouse-keyboard-events.c:110:15: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 2 has type ‘xcb_window_t’ [-Wformat=]
               ev->event, ev->event_x, ev->event_y);
               ^
mouse-keyboard-events.c:117:15: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 2 has type ‘xcb_window_t’ [-Wformat=]
               ev->event, ev->event_x, ev->event_y);
               ^
mouse-keyboard-events.c:125:15: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 2 has type ‘xcb_window_t’ [-Wformat=]
               ev->event);
               ^
mouse-keyboard-events.c:133:15: warning: format ‘%ld’ expects argument
of type ‘long int’, but argument 2 has type ‘xcb_window_t’ [-Wformat=]
               ev->event);
               ^

Thanks, and have a good one


More information about the xorg mailing list