avoid -Waddress in vfprintf-internal.c
Florian Weimer
fweimer@redhat.com
Wed Sep 22 06:13:36 GMT 2021
* Martin Sebor via Libc-alpha:
> Building Glibc with a GCC 12 enhanced to detect more instances
> of comparing addresses to null that are guaranteed to evaluate
> to a constanst triggers a large number of such instancesl.
> The warnings, all isolated to the same file, are valid and
> intended but the Glibc code is safe. They show up because
> the comparison is in a macro to which either null or a constant
> address of an array element are alternately passed as an argument.
>
> The attached patch avoids these warnings by introducing local
> variables for the address being compared (an array element)
> as well as for the null pointer.
>
> Tested by building Glibc on x86_64, verifying the warnings
> are gone, and by running the testsuite and checking for new
> failures.
I'm testing patches to clean this up, with a net reduction in the number
of lines of code.
Thanks,
Florian
More information about the Libc-alpha
mailing list