libs icon indicating copy to clipboard operation
libs copied to clipboard

[BUG]: Possible errors in initializing assignment structures

Open yzewei opened this issue 1 year ago • 4 comments

Describe the bug

Problems discovered during the compilation of drivers_test https://github.com/falcosecurity/libs/tree/master/test/drivers

[ 19%] Building CXX object test/drivers/CMakeFiles/drivers_test.dir/test_suites/syscall_exit_suite/recvmsg_x.cpp.o
/home/yzw/pr/libs/test/drivers/test_suites/syscall_exit_suite/recvmsg_x.cpp: In member function ‘virtual void SyscallExit_recvmsg_ancillary_data_Test::TestBody()’:
/home/yzw/pr/libs/test/drivers/test_suites/syscall_exit_suite/recvmsg_x.cpp:579:3: error: no match for ‘operator=’ (operand types are ‘msghdr’ and ‘<brace-enclosed initializer list>’)
   };
   ^
cmake -DUSE_BUNDLED_DEPS=On -DENABLE_DRIVERS_TESTS=On -DBUILD_LIBSCAP_GVISOR=Off  -DCREATE_TEST_TARGETS=On ..
make drivers_test

How to reproduce

libs/test/drivers/test_suites/syscall_exit_suite/recvmsg_x.cpp :579

                msg.msg_iov = &iov;
                msg.msg_iovlen = 1;
                msg.msg_control = cmsg_buf;
                msg.msg_controllen = sizeof(cmsg_buf);

                msg_controllen = msg.msg_controllen;

yzewei avatar Feb 19 '24 03:02 yzewei