Fix build problems with modern GCC and Clang releases
These patches were uploaded to Bugzilla 3 years ago, but nobody reviews it. I hope the migration to GitLab opens up an opportunity to get these patches merged, so I no longer have to keep these patches on all machines which I use to test GNOME builds. Close #284 and #287 (closed).