Warnings during build with older version of clang
H. Thiele
thiele at streamline-x.org
Fri Apr 12 14:03:38 UTC 2024
Hi there,
I'm currently in the process of rebuilding various things, including
cairo, updating from 1.14.6 to 1.18.0 on an older version of OS X
(10.10.5) with an older version of clang (7.0.2/ clang-700.1.81).
Cairo properly builds through, but I'm getting some suspicious warnings
that tickle my "this build may end up broken" senses ("comparison is
always true/false" stuff).
I probably would first encounter the issues some countless other
packages down the line that depend on cairo. Typically I would
cross-check/ verify with MacPort's build logs, but their website seems
to be broken currently and they only build an older version of cairo.
Anyway…
are this warnings (see attached log) something to be concerned about and
is there possible something I can do on my end to make them properly
disappear? I do not mean the
"-Wno-tautological-constant-out-of-range-compare" option, of course. :^)
I'm not familiar with cairo's code base or newer C standards/ features
— I'm just a user dealing with all the dependencies that come along.
Thanks for any insight in advance.
H. Thiele
-------------- next part --------------
ninja: Entering directory `mybuilddir'
[42/700] Compiling C object src/libcairo.2.dylib.p/cairo-image-surface.c.o
../src/cairo-image-surface.c:95:13: warning: enumeration value 'PIXMAN_r8g8b8_sRGB' not explicitly handled in switch [-Wswitch-enum]
switch (pixman_format) {
^
1 warning generated.
[111/700] Compiling C object src/libcairo.2.dylib.p/cairo-truetype-subset.c.o
../src/cairo-truetype-subset.c:128:9: warning: comparison of constant 100 with expression of type 'cairo_status_t' (aka 'enum _cairo_status') is always false [-Wtautological-constant-out-of-range-compare]
status == (int)CAIRO_INT_STATUS_UNSUPPORTED)
~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[122/700] Compiling C object src/libcairo.2.dylib.p/cairo-quartz-font.c.o
…
[123/700] Compiling C object src/libcairo.2.dylib.p/cairo-svg-surface.c.o
../src/cairo-svg-surface.c:752:17: warning: comparison of constant 2 with expression of type 'cairo_svg_version_t' (aka 'enum _cairo_svg_version') is always true [-Wtautological-constant-out-of-range-compare]
if (version < CAIRO_SVG_VERSION_LAST)
~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
../src/cairo-svg-surface.c:792:17: warning: comparison of constant 2 with expression of type 'cairo_svg_version_t' (aka 'enum _cairo_svg_version') is always false [-Wtautological-constant-out-of-range-compare]
if (version >= CAIRO_SVG_VERSION_LAST)
~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
[132/700] Compiling C object boilerplate/libcairoboilerplate.a.p/cairo-boilerplate.c.o
../boilerplate/cairo-boilerplate.c:65:17: warning: comparison of constant 4294967295 with expression of type 'cairo_content_t' (aka 'enum _cairo_content') is always false [-Wtautological-constant-out-of-range-compare]
if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[139/700] Compiling C object src/libcairo.2.dylib.p/cairo-ps-surface.c.o
../src/cairo-ps-surface.c:1387:15: warning: comparison of constant 2 with expression of type 'cairo_ps_level_t' (aka 'enum _cairo_ps_level') is always true [-Wtautological-constant-out-of-range-compare]
if (level < CAIRO_PS_LEVEL_LAST)
~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
../src/cairo-ps-surface.c:1427:15: warning: comparison of constant 2 with expression of type 'cairo_ps_level_t' (aka 'enum _cairo_ps_level') is always false [-Wtautological-constant-out-of-range-compare]
if (level >= CAIRO_PS_LEVEL_LAST)
~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
2 warnings generated.
…
[141/700] Compiling C object util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-hash.c.o
In file included from ../util/cairo-script/cairo-script-hash.c:41:
../util/cairo-script/cairo-script-private.h:865:22: warning: comparison of constant 72 with expression of type 'const csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
return obj->type == (CSI_OBJECT_TYPE_ARRAY | CSI_OBJECT_ATTR_EXECUTABLE);
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[142/700] Compiling C object util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-file.c.o
In file included from ../util/cairo-script/cairo-script-file.c:37:
../util/cairo-script/cairo-script-private.h:865:22: warning: comparison of constant 72 with expression of type 'const csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
return obj->type == (CSI_OBJECT_TYPE_ARRAY | CSI_OBJECT_ATTR_EXECUTABLE);
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[143/700] Compiling C object util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-interpreter.c.o
In file included from ../util/cairo-script/cairo-script-interpreter.c:39:
../util/cairo-script/cairo-script-private.h:865:22: warning: comparison of constant 72 with expression of type 'const csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
return obj->type == (CSI_OBJECT_TYPE_ARRAY | CSI_OBJECT_ATTR_EXECUTABLE);
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[144/700] Compiling C object util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-objects.c.o
In file included from ../util/cairo-script/cairo-script-objects.c:37:
../util/cairo-script/cairo-script-private.h:865:22: warning: comparison of constant 72 with expression of type 'const csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
return obj->type == (CSI_OBJECT_TYPE_ARRAY | CSI_OBJECT_ATTR_EXECUTABLE);
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../util/cairo-script/cairo-script-objects.c:143:20: warning: comparison of constant 72 with expression of type 'csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
if (obj->type == (CSI_OBJECT_TYPE_ARRAY |
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
[146/700] Compiling C object util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-stack.c.o
In file included from ../util/cairo-script/cairo-script-stack.c:37:
../util/cairo-script/cairo-script-private.h:865:22: warning: comparison of constant 72 with expression of type 'const csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
return obj->type == (CSI_OBJECT_TYPE_ARRAY | CSI_OBJECT_ATTR_EXECUTABLE);
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[150/700] Compiling C object util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-scanner.c.o
In file included from ../util/cairo-script/cairo-script-scanner.c:37:
../util/cairo-script/cairo-script-private.h:865:22: warning: comparison of constant 72 with expression of type 'const csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
return obj->type == (CSI_OBJECT_TYPE_ARRAY | CSI_OBJECT_ATTR_EXECUTABLE);
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[154/700] Linking static target util/cairo-missing/libcairo-missing.a
…
[172/700] Compiling C object src/libcairo.2.dylib.p/cairo-pdf-surface.c.o
../src/cairo-pdf-surface.c:758:17: warning: comparison of constant 4 with expression of type 'cairo_pdf_version_t' (aka 'enum _cairo_pdf_version') is always true [-Wtautological-constant-out-of-range-compare]
if (version < CAIRO_PDF_VERSION_LAST)
~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
../src/cairo-pdf-surface.c:801:17: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
if (version < 0 || version >= CAIRO_PDF_VERSION_LAST)
~~~~~~~ ^ ~
../src/cairo-pdf-surface.c:801:32: warning: comparison of constant 4 with expression of type 'cairo_pdf_version_t' (aka 'enum _cairo_pdf_version') is always false [-Wtautological-constant-out-of-range-compare]
if (version < 0 || version >= CAIRO_PDF_VERSION_LAST)
~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
[178/700] Compiling C object test/cairo-test-suite.p/cairo-test.c.o
../test/cairo-test.c:1282:27: warning: comparison of constant 4294967295 with expression of type 'const cairo_content_t' (aka 'const enum _cairo_content') is always false [-Wtautological-constant-out-of-range-compare]
target->content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../test/cairo-test.c:1306:24: warning: comparison of constant 4294967295 with expression of type 'const cairo_content_t' (aka 'const enum _cairo_content') is always false [-Wtautological-constant-out-of-range-compare]
target->content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
[225/700] Compiling C object util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o
In file included from ../util/cairo-script/cairo-script-operators.c:39:
../util/cairo-script/cairo-script-private.h:865:22: warning: comparison of constant 72 with expression of type 'const csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
return obj->type == (CSI_OBJECT_TYPE_ARRAY | CSI_OBJECT_ATTR_EXECUTABLE);
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../util/cairo-script/cairo-script-operators.c:904:16: warning: comparison of constant 68 with expression of type 'csi_object_type_t' is always false [-Wtautological-constant-out-of-range-compare]
if (obj->type == (CSI_OBJECT_TYPE_NAME | CSI_OBJECT_ATTR_EXECUTABLE)) {
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
[540/700] Compiling C object test/cairo-test-suite.p/subsurface-outside-target.c.o
../test/subsurface-outside-target.c:123:33: warning: comparison of constant 4 with expression of type 'cairo_extend_t' (aka 'enum _cairo_extend') is always true [-Wtautological-constant-out-of-range-compare]
for (extend = 0; extend < N_PADS; extend++) {
~~~~~~ ^ ~~~~~~
1 warning generated.
[611/700] Compiling C object test/cairo-test-suite.p/ps-eps.c.o
../test/ps-eps.c:142:22: warning: comparison of constant 4294967295 with expression of type 'const cairo_content_t' (aka 'const enum _cairo_content') is always false [-Wtautological-constant-out-of-range-compare]
target->content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[620/700] Compiling C object test/cairo-test-suite.p/create-regions.c.o
../test/create-regions.c:185:22: warning: comparison of constant 4294967295 with expression of type 'const cairo_content_t' (aka 'const enum _cairo_content') is always false [-Wtautological-constant-out-of-range-compare]
target->content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[621/700] Compiling C object test/cairo-test-suite.p/fallback-resolution.c.o
../test/fallback-resolution.c:217:22: warning: comparison of constant 4294967295 with expression of type 'const cairo_content_t' (aka 'const enum _cairo_content') is always false [-Wtautological-constant-out-of-range-compare]
target->content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[622/700] Generating test/cairo-logo-font.ttx with a custom command
WARNING: Unknown colorPalettes ['\n', ' ']
[700/700] Linking target perf/cairo-perf-micro
More information about the cairo
mailing list