[Spice-devel] [PATCH v2 2/2] Avoid clang warnings on casts with stricter alignment requirements

Christophe Fergeau cfergeau at redhat.com
Wed May 24 08:46:16 UTC 2017


On Tue, May 23, 2017 at 07:05:18PM +0200, Christophe de Dinechin wrote:
> > , another alternative would be to have a --enable-alignment-debug,
> 
> I tried that, but the problem is to keep that consistent between
> spice-common and spice-gdk (they may have different configuration). Do
> you have a similar case? If so, how do you deal with that?

Why would they have different configuration? AC_CONFIG_SUBDIRS is going
to pass the command line args to spice-common configure script, which
will set (or not set) a SPICE_CHECK_ALIGNMENT #define. There might be a
small added difficulty of making sure #include <mem.h> pick up that
#define both when one from files in spice-common/ and in spice-gtk/, but
that should be workable?
Or am I missing something?

> 
> (I could for example always leave the runtime routines in
> spice-common, even if checks are disabled there, so that you don’t get
> unsatisfied symbols. But that seems a bit ugly).
> 
> 
> > or something like glib (SPICE_XXX_DEBUG=alignment:foo:bar)
> 
> Sorry, I did not really understand that. Do you mean a run-time flag
> check? If so, since Frediano was objecting a one-instruction runtime
> check, I think a runtime flag check would not convince him either.

Ah, if runtime checks are out, forget this ;)

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170524/97778800/attachment.sig>


More information about the Spice-devel mailing list