You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling the gvm-libs branch (master and 20.8.x) the compiler reports the error "equality comparison with extraneous parentheses". Due to the -Werror flag set the warning is turned into an error and the compilation does not finish
Expected behavior
Expectation is to finish the build process.
Actual behavior
Compilation stops with:
/tmp/gvm-libs/base/networking.c:654:27: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
if ((element[0] == 'T'))
~~~~~~~~~~~^~~~~~
/tmp/gvm-libs/base/networking.c:654:27: note: remove extraneous parentheses around the comparison to silence this warning
if ((element[0] == 'T'))
~ ^ ~
/tmp/gvm-libs/base/networking.c:654:27: note: use '=' to turn this equality comparison into an assignment
if ((element[0] == 'T'))
^~
=
/tmp/gvm-libs/base/networking.c:665:32: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
else if ((element[0] == 'U'))
~~~~~~~~~~~^~~~~~
/tmp/gvm-libs/base/networking.c:665:32: note: remove extraneous parentheses around the comparison to silence this warning
else if ((element[0] == 'U'))
~ ^ ~
/tmp/gvm-libs/base/networking.c:665:32: note: use '=' to turn this equality comparison into an assignment
else if ((element[0] == 'U'))
^~
=
2 errors generated.
No, I just want to create a deployment playbook to install OpenVAS by using Ansible. Compiler errors tend to break automatisation. I used no special compile options to check the code for errors, i.e. I did not activate "-Werror,-Wparentheses-equality" on purpose. I just happen to use Clang 12 at the moment.
When compiling the gvm-libs branch (master and 20.8.x) the compiler reports the error "equality comparison with extraneous parentheses". Due to the -Werror flag set the warning is turned into an error and the compilation does not finish
Expected behavior
Expectation is to finish the build process.
Actual behavior
Compilation stops with:
/tmp/gvm-libs/base/networking.c:654:27: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
if ((element[0] == 'T'))
~~~~~~~~~~~^~~~~~
/tmp/gvm-libs/base/networking.c:654:27: note: remove extraneous parentheses around the comparison to silence this warning
if ((element[0] == 'T'))
~ ^ ~
/tmp/gvm-libs/base/networking.c:654:27: note: use '=' to turn this equality comparison into an assignment
if ((element[0] == 'T'))
^~
=
/tmp/gvm-libs/base/networking.c:665:32: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
else if ((element[0] == 'U'))
~~~~~~~~~~~^~~~~~
/tmp/gvm-libs/base/networking.c:665:32: note: remove extraneous parentheses around the comparison to silence this warning
else if ((element[0] == 'U'))
~ ^ ~
/tmp/gvm-libs/base/networking.c:665:32: note: use '=' to turn this equality comparison into an assignment
else if ((element[0] == 'U'))
^~
=
2 errors generated.
Steps to reproduce
GVM versions
Since gvm-libs is the first package to install, there are no installed versions.
Environment
Operating system:
Fix
Remove the extraneous parentheses in the following files:
After removing the extraneous parentheses the code compiles successfully.
The text was updated successfully, but these errors were encountered: