-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation failure on i386 #38
Comments
Thanks for the report. Can you please provide some more information, so that we can reproduce this issue and verify the fix? What OS platform, distribution/release, and compiler version is this? The platform should be accessible with: The distribution version you can often get with something like: The compiler version should be accessible with something like: For example: Linux, Debian 9, compiler version: Thanks! |
$ hostnamectl $ gcc --version |
Hi, When I use that compiler on Debian 10 to compile the Google packetdrill repo at https://github.com/google/packetdrill at SHA1 a700d17 I do not see any warnings or errors. Can you please provide the URL of the packetdrill repo you are using, as well as the SHA1 of the exact commit at which you are compiling? I will only be able to help if you are using the repo at https://github.com/google/packetdrill at the HEAD for that repo (SHA1 a700d17). If you are using some other packetdrill fork then you'll need to contact the author of that fork. Thanks! |
Hi Neal, Do you test on i386 Debian 10? I think this issue should be exist in every i386 platform. BTW, I do use the same repo and commit as you mentioned. |
some errors are easy for outsider, such as paring "%zu" to size_t variable, like:
But,this one:
epollev_expr->ptr->value.num is of type s64, convert to 32-bit pointer make gcc complains, and this is not easy for outsiders |
compilation on i386 complains 2 kinds of error: ---- run_system_call.c: In function ‘cmsg_expect_eq’: run_system_call.c:860:38: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t {aka unsigned int}’ [-Werror=format=] "Bad len in cmsg %d: expected=%lu actual=%lu", ... run_system_call.c: In function ‘get_epoll_event_from_expr’: run_system_call.c:2924:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] event->data.ptr = (void *)epollev_expr->ptr->value.num; .... ---- The 1st error is easy, paring "%zu" with "size_t" would fix; but 2nd one is not easy for outsides, it should be taken care by packetdrill itself. Have reported the issue: google/packetdrill#38. When packetdrill fix compilation on i386, this patch could be reverted. Signed-off-by: Cao jin <jinx.cao@intel.com> Signed-off-by: Philip Li <philip.li@intel.com>
mptcp: add a new 'syscalls' subcategory
make in gtests/net/packetdrill complains:
run_system_call.c: In function ‘cmsg_expect_eq’:
run_system_call.c:860:38: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
"Bad len in cmsg %d: expected=%lu actual=%lu",
~~^
%u
i, ecm->cmsg_len, acm->cmsg_len);
~~~~~~~~~~~~~
run_system_call.c:860:49: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
"Bad len in cmsg %d: expected=%lu actual=%lu",
~~^
%u
i, ecm->cmsg_len, acm->cmsg_len);
~~~~~~~~~~~~~
run_system_call.c: In function ‘get_epoll_event_from_expr’:
run_system_call.c:2924:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
event->data.ptr = (void *)epollev_expr->ptr->value.num;
^
run_system_call.c: In function ‘syscall_epoll_wait’:
run_system_call.c:3129:6: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=]
"epoll_event->data does not match script: "
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
run_system_call.c:3132:6:
event_script.data.u64,
~~~~~~~~~~~~~~~~~~~~~
run_system_call.c:3130:19: note: format string is defined here
"expected: %lu "
~~^
%llu
run_system_call.c:3129:6: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=]
"epoll_event->data does not match script: "
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
run_system_call.c:3133:6:
event_live->data.u64);
~~~~~~~~~~~~~~~~~~~~
run_system_call.c:3131:17: note: format string is defined here
"actual: %lu\n",
~~^
%llu
run_system_call.c: In function ‘syscall_splice’:
run_system_call.c:3249:31: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
result = splice(fd_in_live, (loff_t *) off_in, fd_out_live,
^
run_system_call.c:3250:5: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(loff_t *) off_out, len, flags);
^
cc1: all warnings being treated as errors
make: *** [: run_system_call.o] Error 1
The text was updated successfully, but these errors were encountered: