Skip to content

Fix some warnings on gcc arm

louib requested to merge louib/libhandy:fix_arm_warnings into master

I was getting the following warnings when compiling the library on a RPi:

[23/99] Compiling C object 'src/25a6634@@handy-0.0@sha/hdy-dialer.c.o'.
../src/hdy-dialer.c: In function ‘key_press_event_cb’:
../src/hdy-dialer.c:192:25: warning: cast increases required alignment of target type [-Wcast-align]
   gdk_event_get_keyval ((GdkEvent *) event, &keyval);
                         ^
[31/99] Compiling C object 'src/25a6634@@handy-0.0@sha/hdy-paginator-box.c.o'.
../src/hdy-paginator-box.c: In function ‘hdy_paginator_box_finalize’:
../src/hdy-paginator-box.c:319:27: warning: cast increases required alignment of target type [-Wcast-align]
   HdyPaginatorBox *self = (HdyPaginatorBox *)object;
                           ^
[38/99] Compiling C object 'src/25a6634@@handy-0.0@sha/hdy-preferences-window.c.o'.
../src/hdy-preferences-window.c: In function ‘key_pressed’:
../src/hdy-preferences-window.c:197:25: warning: cast increases required alignment of target type [-Wcast-align]
   gdk_event_get_keyval ((GdkEvent *) event, &keyval);
                         ^
../src/hdy-preferences-window.c:198:24: warning: cast increases required alignment of target type [-Wcast-align]
   gdk_event_get_state ((GdkEvent *) event, &state);
                        ^
[43/99] Compiling C object 'src/25a6634@@handy-0.0@sha/hdy-swipe-tracker.c.o'.
../src/hdy-swipe-tracker.c: In function ‘hdy_swipe_tracker_constructed’:
../src/hdy-swipe-tracker.c:465:27: warning: cast increases required alignment of target type [-Wcast-align]
   HdySwipeTracker *self = (HdySwipeTracker *)object;
                           ^
../src/hdy-swipe-tracker.c: In function ‘hdy_swipe_tracker_dispose’:
../src/hdy-swipe-tracker.c:492:27: warning: cast increases required alignment of target type [-Wcast-align]
   HdySwipeTracker *self = (HdySwipeTracker *)object;
                           ^
[50/99] Compiling C object 'examples/c590b3c@@handy-0.0-demo@exe/hdy-demo-window.c.o'.
../examples/hdy-demo-window.c: In function ‘hdy_demo_window_key_pressed_cb’:
../examples/hdy-demo-window.c:50:25: warning: cast increases required alignment of target type [-Wcast-align]
   gdk_event_get_keyval ((GdkEvent *) event, &keyval);
                         ^
../examples/hdy-demo-window.c:51:24: warning: cast increases required alignment of target type [-Wcast-align]
   gdk_event_get_state ((GdkEvent *) event, &state);
                        ^

Here's the compiler version:

Native C compiler: cc (gcc 8.3.0 "cc (Raspbian 8.3.0-6+rpi1) 8.3.0")
Build machine cpu family: arm
Build machine cpu: armv7l

Merge request reports