Skip to content

Improve meson.build for FreeBSD and reduce the number of warnings during compilation

For the FreeBSD improvement part, there are 2 commits in this merge request which makes meson.build work more like Linux and avoids hard-coding or limiting things to Linux.

For the warning reducing part, there are 3 commits which fixes a few easy-to-fix warnings showed during compilation. These patches neither fix all warnings nor significantly reduce the number of warnings. I still see hundreds of cast alignment and type redefinition warnings during the build.

../../source/gtk+/gdk/broadway/broadway-output.c:42:8: warning: cast from 'guchar *' (aka 'unsigned char *') to 'guint16 *' (aka 'unsigned short *') increases required alignment from 1 to 2 [-Wcast-align]
      *(guint16 *)(header + p) = GUINT16_TO_BE( (guint16)count );
       ^~~~~~~~~~~~~~~~~~~~~~~
../../source/gtk+/gdk/broadway/broadway-output.c:47:8: warning: cast from 'guchar *' (aka 'unsigned char *') to 'guint64 *' (aka 'unsigned long *') increases required alignment from 1 to 8 [-Wcast-align]
      *(guint64 *)(header + p) = GUINT64_TO_BE( count );
       ^~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
../../source/gtk+/gtk/gtksnapshot.h:39:40: warning: redefinition of typedef 'GtkSnapshot' is a C11 feature [-Wtypedef-redefinition]
typedef GdkSnapshot                    GtkSnapshot;
                                       ^
../../source/gtk+/gtk/gtktypes.h:42:40: note: previous definition is here
typedef GdkSnapshot                    GtkSnapshot;
                                       ^
1 warning generated.

Merge request reports