Skip to content

keypad: Fix compilation error for clang

Function hdy_keypad_button_get_digit is declared to return 'char' in src/hdy-keypad-button-private.h but defined to return 'const char' in src/hdy-keypad-button.c. This is not allowed by clang. Since it is unusual to mark a return value itself as const, just drop const here.

[30/104] Compiling C object 'src/25a6634@@handy-0.0@sha/hdy-keypad-button.c.o'.
FAILED: src/25a6634@@handy-0.0@sha/hdy-keypad-button.c.o 
clang -B/home/lantw44/.local/bin -Isrc/25a6634@@handy-0.0@sha -Isrc -I../../source/libhandy/src -I. -I../../source/libhandy/ -I/home/lantw44/gnome/devinstall/include/glib-2.0 -I/home/lantw44/gnome/devinstall/lib/glib-2.0/include -I/usr/local/lib/libffi-3.2.1/include -I/home/lantw44/gnome/devinstall/include/gtk-3.0 -I/home/lantw44/gnome/devinstall/include/pango-1.0 -I/home/lantw44/gnome/devinstall/include/harfbuzz -I/home/lantw44/gnome/devinstall/include/fribidi -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/uuid -I/home/lantw44/gnome/devinstall/include/cairo -I/home/lantw44/gnome/devinstall/include/pixman-1 -I/usr/local/include/libdrm -I/home/lantw44/gnome/devinstall/include/gdk-pixbuf-2.0 -I/home/lantw44/gnome/devinstall/include/gio-unix-2.0 -I/home/lantw44/gnome/devinstall/include/atk-1.0 -I/home/lantw44/gnome/devinstall/include/at-spi2-atk/2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/home/lantw44/gnome/devinstall/include/at-spi-2.0 -I/home/lantw44/gnome/build/libhandy -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu11 -O2 -g -DHAVE_CONFIG_H -DHANDY_COMPILATION -Wcast-align -Wdate-time -Wdeclaration-after-statement -Werror=format-security -Werror=format=2 -Wendif-labels -Werror=incompatible-pointer-types -Werror=missing-declarations -Werror=overflow -Werror=return-type -Werror=shift-count-overflow -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wno-missing-field-initializers -Wno-sign-compare -Wno-strict-aliasing -Wno-unused-parameter -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wtype-limits -Wundef -Wunused-function -fstack-protector-strong -march=corei7 -B/home/lantw44/.local/bin -g3 -Og -gz -fdebug-macro -fPIC -D_THREAD_SAFE -pthread '-DG_LOG_DOMAIN="Handy"' -MD -MQ 'src/25a6634@@handy-0.0@sha/hdy-keypad-button.c.o' -MF 'src/25a6634@@handy-0.0@sha/hdy-keypad-button.c.o.d' -o 'src/25a6634@@handy-0.0@sha/hdy-keypad-button.c.o' -c ../../source/libhandy/src/hdy-keypad-button.c
../../source/libhandy/src/hdy-keypad-button.c:303:1: error: conflicting types for 'hdy_keypad_button_get_digit'
hdy_keypad_button_get_digit (HdyKeypadButton *self)
^
../../source/libhandy/src/hdy-keypad-button-private.h:27:14: note: previous declaration is here
gchar        hdy_keypad_button_get_digit             (HdyKeypadButton *self);
             ^
1 error generated.
[31/104] Compiling C object 'src/25a6634@@handy-0.0@sha/hdy-header-bar.c.o'.
../../source/libhandy/src/hdy-header-bar.c:1305:37: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  GtkRequestedSize side_size[2] = { 0 }; /* The size requested by each side. */
                                    ^
                                    {}
1 warning generated.

Merge request reports