GNOME Bugzilla – Bug 765389
[PATCH] Fix -Werror build for clang
Last modified: 2016-08-16 10:04:22 UTC
Please see the attached patch. It should fix all warnings when compiling with clang.
Created attachment 326513 [details] [review] build: Fix warnings showed by clang This commit fixes three kinds of warning: (1) Unknown option warning: Clang shows warnings instead of errors when unknown warning options are used. This is used to avoid build error on build systems made for GCC, but this also means we have to use -Werror=unknown-warning-option when checking whether a warning option is supported. (2) Cast alignment warning: Clang shows warnings for pointer conversions even if the target machine allows unaligned memory access. I assume all memory access in gtk-vnc is properly aligned and suppress all warnings by converting pointers to void* first. (3) Unused function warning: There is an usused static inline function. It is removed in this commit to avoid the warning.
This patch has stayed in bugzilla for one month. Can it be reviewed?
I think I have to ping again ... Can anyone help review the patch?
I think I really need to ping again ... This patch has stayed here for almost 3 months without begin reviewed.
Adding all those gpointer casts is really not something I'm willing to merge. Either the compiler will need to be made to be quiet, or a better code solution found. The problem with detecting support of warning flags with clang is something that should be fixed in gnulib's 'warnings.m4' file which is what we're using here, since that'll solve the problem for every app not just gtk-vnc.
Created attachment 332046 [details] [review] build: Ignore cast alignment warnings showed by clang
Created attachment 332047 [details] [review] build: Update warnings.m4 from gnulib This fixes unknown option warnings when compiling with clang.
commit ceaeee79fab707513305796202cb1c5c46bce715 Author: Daniel P. Berrange <berrange@redhat.com> Date: Tue Aug 16 11:03:37 2016 +0100 Ignore cast align warnings to avoid tripping up clang Resolves: bz#765389 Signed-off-by: Daniel P. Berrange <berrange@redhat.com> commit 4df8b43dac4c0e9cde401842f5ddf226bb770059 Author: Daniel P. Berrange <berrange@redhat.com> Date: Tue Aug 16 11:01:40 2016 +0100 Update to newer copies of gnulib's warnings code This introduces many more warning flags, and fixes compat with clang Resolves: bz#765389 Signed-off-by: Daniel P. Berrange <berrange@redhat.com>