On 10/13/2016 01:50 PM, Eric Blake wrote:
On 10/13/2016 01:23 PM, Paul Eggert wrote:
> On 10/13/2016 06:36 AM, Eric Blake wrote:
>> That's a bug in s390's system headers. Gnulib should be taught to work
>> around it.
>
> Although this bug was reported fixed in glibc 2.20; see
>
>
https://sourceware.org/bugzilla/show_bug.cgi?id=16712
>
> the Gnulib manual says the bug is still in glibc 2.24; see
> gnulib/doc/posix-headers/stdint.texi. Is the Gnulib manual correct? If
> so, why didn't the earlier glibc patch fix the bug?
>
> Anyway, I installed into Gnulib the attached patch, which I hope works
> around the bug. I can't easily test this, so please give it a try. And
> if you can think of a way to test whether SIZE_MAX has the correct type
> on pre-C11 compilers that lack __typeof__, please let me know.
With gcc, -Werror=format flags a mismatch on printf("%zu",SIZE_MAX).
With C++, you can check whether a correct overloaded function is called.
But I don't have any off-hand way of testing it without using compiler
extensions or a different language.
That said, I think a configure test based on -Werror=format would be
sufficient - after all, our objective is only to fix the problem if it
can be observed. If a platform is using pre-C11 gcc and the problem is
observable, we want it fixed; if they are using some other compiler,
then chances are -Wformat does not work, therefore the problem cannot be
portably observed so there is nothing to work around, whether or not the
problem is present. That's the beauty of testing features rather than
compiler versions :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org