Bug#893601: libperl5.26: printf_format_null Configure test is broken on 64-bits

James Cowgill jcowgill at debian.org
Tue Mar 20 10:23:32 UTC 2018


Package: libperl5.26
Version: 5.26.1-5
Severity: normal
Tags: patch

Hi,

I recently noticed a build failure in the "mrs" package which embeds the
perl interpreter. The strange part was that the error looked completely
generic but only failed on 32-bit for some reason. I traced this to the
value of the PRINTF_FORMAT_NULL_OK config,h option in perl which is
defined on 32-bit, but not defined on 64-bit architectures. This is a
bug because this check detects the behavior of the compiler and should
be the same on all architectures with the same GCC version.

The underlying bug is that the check for this warning causes GCC to emit
an unrelated warning on 64-bit arches which tricks the check into not
defining PRINTF_FORMAT_NULL_OK.

The line which causes the warning is:
 int null_printf (char* pat,...) { return (int)pat; }

GCC complains about the pointer to integer cast of the wrong size but
only on 64-bits. I've attached a patch to fix this by casting through
intptr_t first.

Thanks,
James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-printf-null.diff
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/perl-maintainers/attachments/20180320/0c88326e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/perl-maintainers/attachments/20180320/0c88326e/attachment.sig>


More information about the Perl-maintainers mailing list