https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102329

--- Comment #2 from Hugo van der Sanden <hv at crypt dot org> ---
I guess this is justified by the second paragraph of the -Wmaybe-uninitialized
docs: "In addition, passing a pointer (or in C++, a reference) to an
uninitialized object to a const-qualified function argument is also diagnosed
by this warning."

Firstly, I'd request for this case that the wording of the diagnostic should
clarify that it's the data pointed to that may be used uninitialized rather
than the pointer itself.

Secondly, I think there's a case to be made that 'const void *' should
specifically be exempt from this warning: that a void* is not "a pointer to an
object". (The specific call in the original code was to pthread_getspecific();
it seems reasonable that it should take a 'const void *' as its second
argument.)

Reply via email to