Open skyao opened 3 years ago
Thanks for pointing this out! Do you know if adding this flag affects compilation with (a) older gcc versions, and (b) clang?
If you get a chance to test out that those scenarios work and submit a patch disabling this warning, I will merge it in. In any case, I'll plan to look into this eventually.
I will try it in older gcc version later and update this issue.
I encountered this issue too:
$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
# Add additional compilation flags only after adding subprojects set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -march=native -Wall -Wextra -Werror -pedantic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion -Wold-style-cast -Wno-unused-function") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types -Wno-keyword-macro -Wno-deprecated-declarations") # add this line set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-address-of-packed-member")
Then
make -j
passed.So, should it be a bug or risk that need to be fixed? if not, should we add this
no-address-of-packed-member
to CMAKE_CXX_FLAGS?
succeed in compiling eRPC
after adding -Wno-address-of-packed-member
I just followed the “eRPC quickstart”:
cmake . -DPERF=OFF -DTRANSPORT=infiniband; make -j; sudo ctest.
When I executed
make -j;
, I meet following errors:And this is the source code for this error in file
src/transport_impl/eth_common.h
:I search with google and found some answers in stackoverflow about this error of
address-of-packed-member
:I have tried to add
-Wno-address-of-packed-member
to CMAKE_CXX_FLAGS by modifying fileCMakeLists.txt
:Then
make -j
passed.So, should it be a bug or risk that need to be fixed? if not, should we add this
no-address-of-packed-member
to CMAKE_CXX_FLAGS?Some background, I run this in ubuntu 20.04 with gcc 9.3.0: