-
Notifications
You must be signed in to change notification settings - Fork 861
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
hurd: Avoid warnings #1268
hurd: Avoid warnings #1268
Conversation
How to get a functional Hurd VM:
|
I also have a few fixes for tcpdump, will commit shortly. |
Also, if the system has
But that's a different bug. |
Any objections to merge these changes? |
It should be better to add the warning for L37 in the body on the commit message, like:
|
done so |
The warning for line 37 was: (With clang version 11.0.1) ------------------------------------------------------------------------ ./pcap-hurd.c:196:35: warning: expression does not compute the number of elements in this array; element type is 'struct bpf_insn', not 'short' [-Wsizeof-array-div] (filter_array_t_filter, FILTER_COUNT); ^~~~~~~~~~~~ ./pcap-hurd.c:37:38: note: expanded from macro 'FILTER_COUNT' #define FILTER_COUNT (sizeof(filter) / sizeof(short)) ~~~~~~ ^ ./pcap-hurd.c:32:24: note: array 'filter' declared here static struct bpf_insn filter[] = { ^ ./pcap-hurd.c:196:35: note: place parentheses around the 'sizeof(short)' expression to silence this warning (filter_array_t)filter, FILTER_COUNT); ^ ./pcap-hurd.c:37:38: note: expanded from macro 'FILTER_COUNT' #define FILTER_COUNT (sizeof(filter) / sizeof(short)) ^ ------------------------------------------------------------------------ But device_set_filter really does want the size in units of shorts.
Commit message updated with full warning (place parentheses ...). |
I have no more objections. |
Thank you. |
Should an issue be created on this subject? |
#1269 it is. |
The warning for line 37 was:
But device_set_filter really does want the size in units of shorts.