mjansson/rpmalloc

Not compatible with -Wreserved-identifier

sgraham opened this issue · 2 comments

Hi, clang seems to have become more enthusiastic about reserved identifiers recently. I'm not so sure this is something that's worth fixing, but it does break on sort-of-default whiny compiler settings.

https://logs.chromium.org/logs/gn/buildbucket/cr-buildbucket.appspot.com/8844957368634895280/+/steps/rpmalloc/0/steps/build_rpmalloc-linux-amd64/0/steps/ninja/0/stdout

...
 FAILED: build/ninja/linux/release/x86-64/rpmalloc-a8e50b6/rpmalloc-65d008a.o 
 /b/s/w/ir/k/cipd/bin/clang -MMD -MT build/ninja/linux/release/x86-64/rpmalloc-a8e50b6/rpmalloc-65d008a.o -MF build/ninja/linux/release/x86-64/rpmalloc-a8e50b6/rpmalloc-65d008a.o.d -I.  -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 -std=c11 -m64 -g -DBUILD_RELEASE=1 -O3 -funroll-loops -DENABLE_PRELOAD=1 -DENABLE_OVERRIDE=1 --target=x86_64-linux-gnu --sysroot=/b/s/w/ir/k/cipd/sysroot -c rpmalloc/rpmalloc.c -o build/ninja/linux/release/x86-64/rpmalloc-a8e50b6/rpmalloc-65d008a.o
 rpmalloc/rpmalloc.c:567:12: error: identifier '_rpmalloc_initialized' is reserved because it starts with '_' at global scope [-Werror,-Wreserved-identifier]
 static int _rpmalloc_initialized;
...

I should really clean up the code and not use _ prefix

Fixed in #249 for now, will do a proper cleanup pass and remove all _ prefix when I get the time