Build warnings: cast increases required alignment
Hello!
On latest master clang
throws these warnings:
xfconf-channel.c:1918:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gchar **' (aka 'char **') increases required alignment from 1 to 8 [-Wcast-align]
SET_STRUCT_VAL(gchar *, G_TYPE_STRING, ALIGNOF_GPOINTER,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1933:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'guint32 *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align]
SET_STRUCT_VAL(guint32, G_TYPE_UINT, ALIGNOF_GUINT32,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1938:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gint32 *' (aka 'int *') increases required alignment from 1 to 4 [-Wcast-align]
SET_STRUCT_VAL(gint32, G_TYPE_INT, ALIGNOF_GINT32,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1943:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'guint64 *' (aka 'unsigned long *') increases required alignment from 1 to 8 [-Wcast-align]
SET_STRUCT_VAL(guint64, G_TYPE_UINT64, ALIGNOF_GUINT64,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1948:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gint64 *' (aka 'long *') increases required alignment from 1 to 8 [-Wcast-align]
SET_STRUCT_VAL(gint64, G_TYPE_INT64, ALIGNOF_GINT64,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1953:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gfloat *' (aka 'float *') increases required alignment from 1 to 4 [-Wcast-align]
SET_STRUCT_VAL(gfloat, G_TYPE_FLOAT, ALIGNOF_GFLOAT,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1958:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gdouble *' (aka 'double *') increases required alignment from 1 to 8 [-Wcast-align]
SET_STRUCT_VAL(gdouble, G_TYPE_DOUBLE, ALIGNOF_GDOUBLE,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1963:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gboolean *' (aka 'int *') increases required alignment from 1 to 4 [-Wcast-align]
SET_STRUCT_VAL(gboolean, G_TYPE_BOOLEAN, ALIGNOF_GBOOLEAN,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1970:21: warning: cast from 'guchar *' (aka 'unsigned char *') to 'guint16 *' (aka 'unsigned short *') increases required alignment from 1 to 2 [-Wcast-align]
SET_STRUCT_VAL(guint16, G_TYPE_UINT,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1974:21: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gint16 *' (aka 'short *') increases required alignment from 1 to 2 [-Wcast-align]
SET_STRUCT_VAL(gint16, G_TYPE_INT,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:1911:15: note: expanded from macro 'SET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2137:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gchar **' (aka 'char **') increases required alignment from 1 to 8 [-Wcast-align]
GET_STRUCT_VAL(gchar *, G_TYPE_STRING, ALIGNOF_GPOINTER,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2152:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'guint32 *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align]
GET_STRUCT_VAL(guint32, G_TYPE_UINT, ALIGNOF_GUINT32,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2157:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gint32 *' (aka 'int *') increases required alignment from 1 to 4 [-Wcast-align]
GET_STRUCT_VAL(gint32, G_TYPE_INT, ALIGNOF_GINT32,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2162:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'guint64 *' (aka 'unsigned long *') increases required alignment from 1 to 8 [-Wcast-align]
GET_STRUCT_VAL(guint64, G_TYPE_UINT64, ALIGNOF_GUINT64,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2167:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gint64 *' (aka 'long *') increases required alignment from 1 to 8 [-Wcast-align]
GET_STRUCT_VAL(gint64, G_TYPE_INT64, ALIGNOF_GINT64,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2172:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gfloat *' (aka 'float *') increases required alignment from 1 to 4 [-Wcast-align]
GET_STRUCT_VAL(gfloat, G_TYPE_FLOAT, ALIGNOF_GFLOAT,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2177:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gdouble *' (aka 'double *') increases required alignment from 1 to 8 [-Wcast-align]
GET_STRUCT_VAL(gdouble, G_TYPE_DOUBLE, ALIGNOF_GDOUBLE,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2182:17: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gboolean *' (aka 'int *') increases required alignment from 1 to 4 [-Wcast-align]
GET_STRUCT_VAL(gboolean, G_TYPE_BOOLEAN, ALIGNOF_GBOOLEAN,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2189:21: warning: cast from 'guchar *' (aka 'unsigned char *') to 'guint16 *' (aka 'unsigned short *') increases required alignment from 1 to 2 [-Wcast-align]
GET_STRUCT_VAL(guint16, XFCONF_TYPE_UINT16,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2193:21: warning: cast from 'guchar *' (aka 'unsigned char *') to 'gint16 *' (aka 'short *') increases required alignment from 1 to 2 [-Wcast-align]
GET_STRUCT_VAL(gint16, XFCONF_TYPE_INT16,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xfconf-channel.c:2129:15: note: expanded from macro 'GET_STRUCT_VAL'
__val_p = (ctype *)(((guchar *)(&(((DummyStruct *)value_struct)->a)))+cur_offset); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 warnings generated.
Thanks!