Skip to content

Build with clang

Diego Pino requested to merge dpino/sysprof:build-with-clang into master

While building using clang I got a few errors:

$ CC=clang CXX=clang++ meson _build
$ ninja -C _build
In file included from ../src/libsysprof-capture/sysprof-address.c:67:
../src/libsysprof-capture/sysprof-address.h:70:1: error: expected identifier or '('
SYSPROF_STATIC_ASSERT (sizeof (SysprofAddress) >= sizeof (void *),
^
../src/libsysprof-capture/sysprof-macros.h:78:45: note: expanded from macro 'SYSPROF_STATIC_ASSERT'
# define SYSPROF_STATIC_ASSERT(expr, msg) ((void) sizeof (char[(expr) ? 1 : -1]))

Once fixed the error in that macro I got another error due to -Werror=shadow, which I disabled it for Clang.

Once built tests seem to be running Ok:

$ ninja -C _build test
ninja: Entering directory `_build'
[3/4] Running all tests.
1/5 test-capture                            OK       0.02 s 
2/5 test-capture-cursor                     OK       0.01 s 
3/5 test-mapped-ring-buffer                 OK       0.02 s 
4/5 test-model-filter                       OK       0.04 s 
5/5 test-zoom                               OK       0.01 s 

Ok:                    5
Expected Fail:         0
Fail:                  0
Unexpected Pass:       0
Skipped:               0
Timeout:               0

Merge request reports