Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clang - how to disable [-Werror,-Wpointer-bool-conversion]

Tags:

warnings

clang

I want to compile a project with clang, and got some errors like error: [-Werror,-Wpointer-bool-conversion]

  1. I didn't set -Wpointer-bool-conversion as error, does clang do it by default?
  2. How to turn off this error, treat it as normal warning, I don't want to break the compiling with this warning.
  3. If I add -Wno-pointer-bool-conversion, then the error is gone, also the warning, I want to keep the warning.

Any ideas? Thanks

like image 220
thisEric Avatar asked Mar 04 '16 13:03

thisEric


People also ask

How do I turn off GCC warning?

The warning is emitted only with --coverage enabled. By default, this warning is enabled and is treated as an error. -Wno-coverage-invalid-line-number can be used to disable the warning or -Wno-error=coverage-invalid-line-number can be used to disable the error. Suppress warning messages emitted by #warning directives.

What is werror?

-Werror= Make the specified warning into an error. The specifier for a warning is appended, for example -Werror=switch turns the warnings controlled by -Wswitch into errors.

Which flag would you pass to your C++ compiler so it warns you about implicit conversions?

By default, Fuchsia C/C++ code compiles with the flag -Wconversion , which prohibits implicit type conversions that may alter a value.


1 Answers

-Wno-error=pointer-bool-conversion will resolve my problem

like image 159
thisEric Avatar answered Sep 25 '22 14:09

thisEric