Skip to content

example/rdma_performance compile error in gcc 11: error: macro "__has_attribute" requires an identifier #2740

Description

@ivanallen

Describe the bug (描述bug)

g++ -c -I/usr/include/ -I../../output/include -std=c++0x -DBRPC_WITH_GLOG=0 -DGFLAGS_NS=google -D__const__=__unused__ -g -DBRPC_WITH_RDMA -std=c++0x -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Wno-unused-parameter -fPIC -fno-omit-frame-pointer test.pb.cc -o test.pb.o
<command-line>: warning: "__const__" redefined
<command-line>: note: this is the location of the previous definition
In file included from /usr/include/features.h:486,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/limits:42,
                 from test.pb.h:7,
                 from test.pb.cc:4:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
make: *** [Makefile:98: test.pb.o] Error 1
rm test.pb.cc

To Reproduce (复现方法)

Expected behavior (期望行为)

Versions (各种版本)
OS:
Compiler:
brpc:
protobuf:

Additional context/screenshots (更多上下文/截图)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions