[Spice-devel] [PATCH v4 0/3] macOS enablement patches
Christophe de Dinechin
christophe at dinechin.org
Tue May 30 12:51:48 UTC 2017
From: Christophe de Dinechin <dinechin at redhat.com>
This patch set eliminates warnings detected by clang with respect
to type alignments. Vittorio Toso had submitted something
similar. In this version, I took into account comments by
Christophe Fergeau regarding how to know which casts were
aligned and which ones were not aligned. I added some
instrumentation to detect the two cases.
v2 changes:
- Fix alignment used for checking (alignment of pointed type, not pointer)
- Disable checking entirely if NDEBUG is defined.
- Add G_UNLIKELY to indicate that the branch is not likely to be taken
I saw no obvious equivalent of NDEBUG in Spice code, so I used NDEBUG,
which is the macro used to disable assert() defined in <assert.h>.
v3 changes:
- Group all stylistic changes together
- Additional style consistency cleanup suggested by Frediano
- Disable misaligned check unless compiled with CFLAGS=-DSPICE_DEBUG_ALIGNMENT
v4 changes:
Add --enable-alignment-checks configuration option, disable runtime checks
by default.
Christophe de Dinechin (3):
Avoid clang warnings on casts with stricter alignment requirements
Put alignment checks under #ifdef SPICE_DEBUG_ALIGNMENT
Add configure option for --enable-alignment-checks
common/canvas_base.c | 14 +++++++++-----
common/mem.c | 22 ++++++++++++++++++++++
common/mem.h | 41 +++++++++++++++++++++++++++++++++++++++++
common/sw_canvas.c | 11 ++++++-----
configure.ac | 8 ++++++++
5 files changed, 86 insertions(+), 10 deletions(-)
--
2.11.0 (Apple Git-81)
More information about the Spice-devel
mailing list