On 27.05.22 13:00, Andrey Semashev via Boost wrote:
It *is* a useless warning. The code with NULL is explicit enough and portable, so what is this warning about? That the code is not C++11-only? I know that, and it's not up to the compiler to tell me that.
This is not a case of the compiler, on its own initiative, warning you about the code. This is a case of the end user explicitly telling the compiler to warn about the code, and the compiler complying with the end user's wishes. As I understand it, this warning is not included under -Wall or -Wextra, so it needs to be enabled individually. I wish there were a good way to tell the compiler to limit warning to user code and to turn them all off in libraries. If the end user wants to enforce the use of nullptr in their code, let them, but don't let them force that choice onto library authors. -- Rainer Deyke (rainerd@eldwood.com)