Skip to content

Compilation error under the latest fedora #263

Closed

Description

@jvoisin

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

Activity

  1. mjansson commented on Nov 25, 2021

    @mjansson
    Owner

    I’ll have a look at this today

  2. self-assigned this
    on Nov 25, 2021
  3. mjansson commented on Nov 28, 2021

    @mjansson
    Owner

    Updated the variable names to avoid reserved _names

  4. jvoisin commented on Nov 30, 2021

    @jvoisin
    Author

    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.
  5. mjansson commented on Dec 7, 2021

    @mjansson
    Owner

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

  6. jvoisin commented on Dec 8, 2021

    @jvoisin
    Author

    Looks like it's working, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions