HardySimpson / zlog

A reliable, high-performance, thread safe, flexsible, clear-model, pure C logging library.
Apache License 2.0
2.25k stars 721 forks source link

build failed for -Werror=pointer-to-int-cast #253

Closed qaqland closed 6 months ago

qaqland commented 7 months ago
...
cd src && make all
make[1]: Entering directory '/home/qaq/aports/testing/zlog/src/zlog-1.2.17/src'
gcc -std=c99 -pedantic -c -O2 -fPIC -pthread -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -Wall -Werror -Wstrict-prototypes -fwrapv -g -ggdb buf.c
gcc -std=c99 -pedantic -c -O2 -fPIC -pthread -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -Wall -Werror -Wstrict-prototypes -fwrapv -g -ggdb category.c
gcc -std=c99 -pedantic -c -O2 -fPIC -pthread -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -Wall -Werror -Wstrict-prototypes -fwrapv -g -ggdb category_table.c
gcc -std=c99 -pedantic -c -O2 -fPIC -pthread -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -Wall -Werror -Wstrict-prototypes -fwrapv -g -ggdb conf.c
gcc -std=c99 -pedantic -c -O2 -fPIC -pthread -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -Wall -Werror -Wstrict-prototypes -fwrapv -g -ggdb event.c
event.c: In function 'zlog_event_new':
event.c:94:72: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   94 |         a_event->tid_hex_str_len = sprintf(a_event->tid_hex_str, "%x", (unsigned int)a_event->tid);
      |                                                                        ^
gcc -std=c99 -pedantic -c -O2 -fPIC -pthread -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -Wall -Werror -Wstrict-prototypes -fwrapv -g -ggdb format.c
cc1: all warnings being treated as errors