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))