Skip Menu |

This queue is for tickets about the File-Map CPAN distribution.

Report information
The Basics
Id: 77660
Status: resolved
Priority: 0/
Queue: File-Map

People
Owner: Nobody in particular
Requestors: jquelin [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: 0.51



Subject: compilation fails with -Werror=format-security
$ ./Build Building File-Map gcc -I/usr/lib/perl5/5.16.0/i386-linux-thread-multi/CORE -DXS_VERSION="0.50" -DVERSION="0.50" -fPIC -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -pthread -o lib/File/Map.o lib/File/Map.c lib/File/Map.xs: In function 'check_new_variable': lib/File/Map.xs:345:3: error: format not a string literal and no format arguments [-Werror=format-security] cc1: some warnings being treated as errors error building lib/File/Map.o from 'lib/File/Map.c' at /usr/lib/perl5/5.16.0/ExtUtils/CBuilder/Base.pm line 177. error: Bad exit status from /home/iurt/rpm/tmp/rpm-tmp.cNWeNJ (%build) attached patch fixes the problem.
Subject: File-Map-0.50-format_security.patch
--- BUILD/File-Map-0.50/lib/File/Map.xs~ 2012-05-01 22:37:50.000000000 +0200 +++ BUILD/File-Map-0.50/lib/File/Map.xs 2012-06-06 10:32:11.995026320 +0200 @@ -342,7 +342,7 @@ Perl_croak(aTHX_ "Trying to map into a nonscalar!\n"); SV_CHECK_THINKFIRST(var); if (SvREADONLY(var)) - Perl_croak(aTHX_ PL_no_modify); + Perl_croak("%s", aTHX_ PL_no_modify); if (SvMAGICAL(var) && mg_find(var, PERL_MAGIC_uvar)) sv_unmagic(var, PERL_MAGIC_uvar); if (SvROK(var))
On Wed Jun 06 04:37:24 2012, JQUELIN wrote: Show quoted text
> attached patch fixes the problem.
Fixed in 0.51. Your fix wasn't correct though, aTHX_ must come before the format. Leon