pmem / issues

Old issues repo for PMDK.
http://pmem.io
13 stars 7 forks source link

pmdk 1.4 does not build with clang #847

Closed tschuett closed 6 years ago

tschuett commented 6 years ago

pmdk 1.4 fails to build on CentOS with clang 6.0

>  clang -v
clang version 6.0.0
> make CC=clang CXX=clang++
...
> clang -MD -c -o ../nondebug/libpmemobj/heap.o -std=gnu99 -Wall -Werror -Wmissing-prototypes -Wpointer-arith -Wsign-conversion -Wsign-compare -Wconversion -Wunused-macros -Wmissing-field-initializers -Wunreachable-code-return -Wmissing-variable-declarations -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -std=gnu99 -fno-common -pthread -DSRCVERSION=\"1.4\"   -DUSE_LIBDL -D_PMEMOBJ_INTRNL -I../include -I../common/  -fPIC  heap.c
heap.c:424:18: error: implicit conversion loses integer precision: 'const enum chunk_flags' to 'uint16_t' (aka 'unsigned short') [-Werror,-Wconversion]
        run_hdr.flags = header_type_to_flag[c->header_type];
                      ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
lukaszstolarczuk commented 6 years ago

Verified on CentOS 7.4, on PMDK v. 1.4-rc4-450-gb6b2808