erpc-io / eRPC

Efficient RPCs for datacenter networks
https://erpc.io/
Other
835 stars 137 forks source link

Minor: fix assert in alloc_from_class #95

Open liangcheng-yu opened 1 year ago

liangcheng-yu commented 1 year ago

Hi Anuj! This is Liangcheng. Happened to notice a minor typo in https://github.com/erpc-io/eRPC/blob/master/src/util/huge_alloc.h#L206 which reads assert(buffer.class_size_ = class_max_size(size_class));. It gives me compiler error when running cmake . -DPERF=OFF -DTRANSPORT=dpdk; make -j16

/home/liangcheng/eRPC/src/util/huge_alloc.h:206:31: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  206 |     assert(buffer.class_size_ = class_max_size(size_class));
      |            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Adding set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-parentheses") to CMakeLists.txt can also resolve/bypass the error and give me successful make but I believe it was an unintended typo.

For context, my local setup:

Thanks!