The function I want to run:
struct foo;
void bar(const foo* p = 0);
How I call the function:
auto thread = std::thread(&bar, NULL);
The warning:
foobar.h:223:9: warning: passing NULL to non-pointer argument 2 of ‘std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (*)(const foo*), _Args = {int}]’ [-Wconversion-null]
What am I missing here?
When I call the function with non-NULL
argument, the warning goes away.