-
Notifications
You must be signed in to change notification settings - Fork 68
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
lvm2 fails to build with -Wparentheses #55
Comments
The code of interest was introduced in 74ae1c5. |
I've created a pull request at #56. |
Solved upstream with few more patches as can be seen in this BZ As the standalone parentheses fix would cause actually way more troubles to the users - since the error path on incorrect cache settings is way more easier to hit. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
libdm/libdm-deptree.c fails to build with -Wparentheses on Chrome OS and produces the following error,
lvm2-2.02.187-r3: libdm-deptree.c:2467:81: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]
lvm2-2.02.187-r3: EMIT_PARAMS(pos, " %u", (seg->policy_argc + (seg->migration_threshold != 2048) ? 1 : 0) * 2);
lvm2-2.02.187-r3: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
lvm2-2.02.187-r3: libdm-deptree.c:2037:59: note: expanded from macro 'EMIT_PARAMS'
lvm2-2.02.187-r3: if ((w = dm_snprintf(params + p, paramsize - (size_t) p, str)) < 0) {
lvm2-2.02.187-r3: ^~~
lvm2-2.02.187-r3: libdm-deptree.c:2467:81: note: place parentheses around the '+' expression to silence this warning
lvm2-2.02.187-r3: EMIT_PARAMS(pos, " %u", (seg->policy_argc + (seg->migration_threshold != 2048) ? 1 : 0) * 2);
lvm2-2.02.187-r3: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
lvm2-2.02.187-r3: libdm-deptree.c:2037:59: note: expanded from macro 'EMIT_PARAMS'
lvm2-2.02.187-r3: if ((w = dm_snprintf(params + p, paramsize - (size_t) p, str)) < 0) {
lvm2-2.02.187-r3: ^~~
lvm2-2.02.187-r3: libdm-deptree.c:2467:81: note: place parentheses around the '?:' expression to evaluate it first
lvm2-2.02.187-r3: EMIT_PARAMS(pos, " %u", (seg->policy_argc + (seg->migration_threshold != 2048) ? 1 : 0) * 2);
lvm2-2.02.187-r3: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
lvm2-2.02.187-r3: libdm-deptree.c:2037:59: note: expanded from macro 'EMIT_PARAMS'
lvm2-2.02.187-r3: if ((w = dm_snprintf(params + p, paramsize - (size_t) p, str)) < 0) {
lvm2-2.02.187-r3: ^~~
lvm2-2.02.187-r3: 1 warning generated.
More details can be found at https://b.corp.google.com/issues/195062447.
The text was updated successfully, but these errors were encountered: