Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error under the latest fedora #263

Closed
jvoisin opened this issue Nov 24, 2021 · 5 comments
Closed

Compilation error under the latest fedora #263

jvoisin opened this issue Nov 24, 2021 · 5 comments
Assignees

Comments

@jvoisin
Copy link

jvoisin commented Nov 24, 2021

The compilation fails due to some warnings, because -Werror is set by default:

[37/54] CC test/main.c
FAILED: build/ninja/linux/debug/x86-64/test-57ec084/main-28e5055.o 
clang -MMD -MT build/ninja/linux/debug/x86-64/test-57ec084/main-28e5055.o -MF build/ninja/linux/debug/x86-64/test-57ec084/main-28e5055.o.d -I. -Irpmalloc -Itest -DRPMALLOC_COMPILE=1 -funit-at-a-time -fstrict-aliasing -fvisibility=hidden -fno-stack-protector -fomit-frame-pointer -fno-math-errno -ffinite-math-only -funsafe-math-optimizations -fno-trapping-math -ffast-math -D_GNU_SOURCE=1 -W -Werror -pedantic -Wall -Weverything -Wno-c++98-compat -Wno-padded -Wno-documentation-unknown-command -Wno-implicit-fallthrough -Wno-static-in-inline -Wno-reserved-id-macro -Wno-disabled-macro-expansion -std=c11 -m64 -g -DBUILD_DEBUG=1 -DENABLE_ASSERTS=1 -DENABLE_STATISTICS=1 -DRPMALLOC_FIRST_CLASS_HEAPS=1 -DRPMALLOC_CONFIGURABLE=1  -c test/main.c -o build/ninja/linux/debug/x86-64/test-57ec084/main-28e5055.o
test/main.c:28:15: error: identifier '_hardware_threads' is reserved because it starts with '_' at global scope [-Werror,-Wreserved-identifier]
static size_t _hardware_threads;
              ^
test/main.c:29:12: error: identifier '_test_failed' is reserved because it starts with '_' at global scope [-Werror,-Wreserved-identifier]
static int _test_failed;
           ^
test/main.c:429:16: error: identifier '_allocator_thread_arg' is reserved because it starts with '_' at global scope [-Werror,-Wreserved-identifier]
typedef struct _allocator_thread_arg {
               ^
3 errors generated.
[38/54] CC rpmalloc/rpmalloc.c
ninja: build stopped: subcommand failed.
Error: Process completed with exit code 1.

This is currently blocking daanx/mimalloc-bench#47

@mjansson
Copy link
Owner

I’ll have a look at this today

@mjansson mjansson self-assigned this Nov 25, 2021
@mjansson
Copy link
Owner

Updated the variable names to avoid reserved _names

@jvoisin
Copy link
Author

jvoisin commented Nov 30, 2021

Still failing :/

[37/54] CC test/main.c
FAILED: build/ninja/linux/debug/x86-64/test-57ec084/main-28e5055.o 
clang -MMD -MT build/ninja/linux/debug/x86-64/test-57ec084/main-28e5055.o -MF build/ninja/linux/debug/x86-64/test-57ec084/main-28e5055.o.d -I. -Irpmalloc -Itest -DRPMALLOC_COMPILE=1 -funit-at-a-time -fstrict-aliasing -fvisibility=hidden -fno-stack-protector -fomit-frame-pointer -fno-math-errno -ffinite-math-only -funsafe-math-optimizations -fno-trapping-math -ffast-math -D_GNU_SOURCE=1 -W -Werror -pedantic -Wall -Weverything -Wno-c++98-compat -Wno-padded -Wno-documentation-unknown-command -Wno-implicit-fallthrough -Wno-static-in-inline -Wno-reserved-id-macro -Wno-disabled-macro-expansion -std=c11 -m64 -g -DBUILD_DEBUG=1 -DENABLE_ASSERTS=1 -DENABLE_STATISTICS=1 -DRPMALLOC_FIRST_CLASS_HEAPS=1 -DRPMALLOC_CONFIGURABLE=1  -c test/main.c -o build/ninja/linux/debug/x86-64/test-57ec084/main-28e5055.o
test/main.c:429:16: error: identifier '_allocator_thread_arg' is reserved because it starts with '_' at global scope [-Werror,-Wreserved-identifier]
typedef struct _allocator_thread_arg {
               ^
1 error generated.
[38/54] CC rpmalloc/rpmalloc.c
ninja: build stopped: subcommand failed.
Error: Process completed with exit code 1.

@mjansson
Copy link
Owner

mjansson commented Dec 7, 2021

Try now, compiles cleanly now on my ubuntu system at least

@jvoisin
Copy link
Author

jvoisin commented Dec 8, 2021

Looks like it's working, thanks!

@jvoisin jvoisin closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants