undefined `false` when compiling
Shoreshen opened this issue · 1 comments
Shoreshen commented
I'm using manjaro and gcc 12.2.1 and compiling rpmalloc.c
with my project.
The error message I got is as follow:
[shore@shore-82b6 MYCGRA]$ make dbg.out
gcc -m64 -g -lcgraph -lgvc -c src/bitmatrix.c -o src/bitmatrix.o
gcc -m64 -g -lcgraph -lgvc -c src/CGRA.c -o src/CGRA.o
gcc -m64 -g -lcgraph -lgvc -c src/codegen.c -o src/codegen.o
gcc -m64 -g -lcgraph -lgvc -c src/dfg.c -o src/dfg.o
gcc -m64 -g -lcgraph -lgvc -c src/operation.c -o src/operation.o
gcc -m64 -g -lcgraph -lgvc -c src/readdot.c -o src/readdot.o
gcc -m64 -g -lcgraph -lgvc -c src/VF3.c -o src/VF3.o
gcc -m64 -g -lcgraph -lgvc -c ./src/main.c -o src/main.o
gcc -m64 -g -lcgraph -lgvc -c ./rpmalloc/rpmalloc/rpmalloc.c -o src/rpmalloc.o
./rpmalloc/rpmalloc/rpmalloc.c: 在函数‘_rpmalloc_allocate_from_heap_fallback’中:
./rpmalloc/rpmalloc/rpmalloc.c:69:45: 错误:‘false’未声明(在此函数内第一次使用)
69 | if (!__builtin_expect(cond, false)) \
| ^~~~~
./rpmalloc/rpmalloc/rpmalloc.c:2143:9: 附注:in expansion of macro ‘rpmalloc_assume’
2143 | rpmalloc_assume(heap);
| ^~~~~~~~~~~~~~~
./rpmalloc/rpmalloc/rpmalloc.c:292:1: 附注:‘false’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
291 | #include <stdatomic.h>
+++ |+#include <stdbool.h>
292 |
./rpmalloc/rpmalloc/rpmalloc.c:69:45: 附注:每个未声明的标识符在其出现的函数内只报告一次
69 | if (!__builtin_expect(cond, false)) \
| ^~~~~
./rpmalloc/rpmalloc/rpmalloc.c:2143:9: 附注:in expansion of macro ‘rpmalloc_assume’
2143 | rpmalloc_assume(heap);
| ^~~~~~~~~~~~~~~
./rpmalloc/rpmalloc/rpmalloc.c:2143:25: 警告:传递‘__builtin_expect’的第 1 个参数时将指针赋给整数,未作类型转换 [-Wint-conversion]
2143 | rpmalloc_assume(heap);
| ^~~~
| |
| heap_t *
./rpmalloc/rpmalloc/rpmalloc.c:69:39: 附注:in definition of macro ‘rpmalloc_assume’
69 | if (!__builtin_expect(cond, false)) \
| ^~~~
./rpmalloc/rpmalloc/rpmalloc.c:2143:25: 附注:需要类型‘long int’,但实参的类型为‘heap_t *’
2143 | rpmalloc_assume(heap);
| ^~~~
./rpmalloc/rpmalloc/rpmalloc.c:69:39: 附注:in definition of macro ‘rpmalloc_assume’
69 | if (!__builtin_expect(cond, false)) \
| ^~~~
make: *** [makefile:20: src/rpmalloc.o] Error 1