GNOME Bugzilla – Bug 753435
Fix -Werror build for clang
Last modified: 2015-08-10 07:54:21 UTC
This error showed when compiling gtksourceview with clang: gtksourceview.c:4461:10: error: cast from 'const guchar *' (aka 'const unsigned char *') to 'guint16 *' (aka 'unsigned short *') increases required alignment from 1 to 2 [-Werror,-Wcast-align] vals = (guint16 *) gtk_selection_data_get_data (selection_data); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
Created attachment 308998 [details] [review] build: Fix cast align warning for clang
Review of attachment 308998 [details] [review]: See the comment. ::: gtksourceview/gtksourceview.c @@ +4459,3 @@ } + vals = (guint16 *)(void *) gtk_selection_data_get_data (selection_data); you could just do (gpointer) gtk_selection_data_get_data (selection_data);?
Created attachment 309000 [details] [review] build: Fix cast align warning for clang
Review of attachment 309000 [details] [review]: Looks good.
Attachment 309000 [details] pushed as 4343423 - build: Fix cast align warning for clang