MantisBT - LibCSS | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0002870 | LibCSS | LibCSS | public | 2024-03-09 04:21 | 2024-05-25 11:14 |
Reporter | Richard Bauer | ||||
---|---|---|---|---|---|
Assigned To | Vincent Sanders | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | i686-linux | OS | GNU Guix | OS Version | |
Fixed in CI build # | |||||
Reported in CI build # | |||||
Summary | 0002870: 0.9.2 tests fail to build on 32-bit system | ||||
Description | When attempting to compile libcss tests for a i686-linux system, I get the following error: ``` In file included from test/css21.c:11: test/dump.h: In function ‘dump_rule_media’: test/dump.h:134:45: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=] 134 | ptr += sprintf(ptr, "| @media %s%03lx", | ~~~~^ | | | long unsigned int | %03llx 135 | s->media->negate_type ? "not " : "", 136 | s->media->type); | ~~~~~~~~~~~~~~ | | | uint64_t {aka long long unsigned int} In file included from test/parse2-auto.c:12: test/dump.h: In function ‘dump_rule_media’: test/dump.h:134:45: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=] 134 | ptr += sprintf(ptr, "| @media %s%03lx", | ~~~~^ | | | long unsigned int | %03llx 135 | s->media->negate_type ? "not " : "", 136 | s->media->type); | ~~~~~~~~~~~~~~ | | | uint64_t {aka long long unsigned int} COMPILE: test/select.c LINK: build-i686-unknown-linux-gnu-i686-unknown-linux-gnu-release-lib-shared/test_lex LINK: build-i686-unknown-linux-gnu-i686-unknown-linux-gnu-release-lib-shared/test_parse LINK: build-i686-unknown-linux-gnu-i686-unknown-linux-gnu-release-lib-shared/test_csdetect LINK: build-i686-unknown-linux-gnu-i686-unknown-linux-gnu-release-lib-shared/test_number LINK: build-i686-unknown-linux-gnu-i686-unknown-linux-gnu-release-lib-shared/test_lex-auto LINK: build-i686-unknown-linux-gnu-i686-unknown-linux-gnu-release-lib-shared/test_parse-auto cc1: all warnings being treated as errors ``` The format specifier `%lx` does not match the `uint64_t` declaration on 32-bit systems, where `long int` is not 64 bits wide. Anyhow, the following patch appears to fix the issue: ``` --- a/test/dump.h +++ b/test/dump.h @@ -131,7 +131,7 @@ void dump_rule_media(css_rule_media *s, char **buf, size_t *buflen) char *ptr = *buf; css_rule *rule; - ptr += sprintf(ptr, "| @media %s%03lx", + ptr += sprintf(ptr, "| @media %s%03" PRIx64, s->media->negate_type ? "not " : "", s->media->type); ``` since the <inttypes.h> header is already in use. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files |
Notes | |||||
|
|||||
|
|
Issue History | |||||
Date Modified | Username | Field | Change | ||
---|---|---|---|---|---|
2024-03-09 04:21 | Richard Bauer | New Issue | |||
2024-05-25 11:14 | Vincent Sanders | Assigned To | => Vincent Sanders | ||
2024-05-25 11:14 | Vincent Sanders | Status | new => resolved | ||
2024-05-25 11:14 | Vincent Sanders | Resolution | open => fixed | ||
2024-05-25 11:14 | Vincent Sanders | Description Updated | bug_revision_view_page.php?rev_id=2201#r2201 | ||
2024-05-25 11:14 | Vincent Sanders | Note Added: 0002448 |