Skip to content

Compilation with clang 6.0 fails because __USE_GNU is implicitly defined by clang #435

@SX91

Description

@SX91

Trying to build hazelcast-cpp-client on Ubuntu 18.04 with clang 6.0 (with libc++) I got an error:

hazelcast-cpp-client/hazelcast/src/hazelcast/util/Util.cpp:147:24: error: 
      cannot initialize return object of type 'int' with an rvalue of type 'char *'
                return ::strerror_r(errnum, strerrbuf + numChars, buflen - numChars);

Seems like clang defines __USE_GNU, which exposes GNU implementation of strerror_r instead of a POSIX one.

You should probably change #elif defined(__llvm__) to #elif defined(__llvm__) && not defined(__USE_GNU) (or _GNU_SOURCE?). Or simply use something like that.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions