Skip Menu |
 

This queue is for tickets about the YAML-Syck CPAN distribution.

Report information
The Basics
Id: 74785
Status: resolved
Priority: 0/
Queue: YAML-Syck

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

Bug Information
Severity: Normal
Broken in: 1.19
Fixed in: 1.20_01



Subject: compiling with -Werror=format-security fails
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1328722047-17365-149"
Content-Length: 0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 1137
Download (untitled) / with headers
text/plain 1.1k
Hi, Mandriva compiles C source code with -Werror=format-security and Debian plans to do this too (see http://article.gmane.org/gmane.comp.lang.perl.perl5.porters/105559). Compiling YAML::Syck fails with the following error message if -Werror=format-security is used: In file included from Syck.xs:2:0: perl_common.h: In function 'perl_syck_error_handler': perl_common.h:79:9: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat] perl_common.h:79:9: error: format not a string literal and no format arguments [-Werror=format-security] This is the function in perl_common.h that GCC complains about: void perl_syck_error_handler(SyckParser *p, char *msg) { croak(form( "%s parser (line %d, column %ld): %s", "Syck", p->linect + 1, p->cursor - p->lineptr, msg )); } The form() call seems to be redundant as croak() already accepts a format. I've attached a patch that removes form() and thus makes GCC happy. The patch also casts the result of (p->cursor - p->lineptr) to "long" in order to get rid of the warning regarding '%ld'. -- Regards, Andreas
Subject: perl_common_h.diff.txt
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; name="perl_common_h.diff.txt"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="perl_common_h.diff.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: ascii
Content-Length: 526
--- perl_common.h.orig 2011-11-02 08:33:59.000000000 +0100 +++ perl_common.h 2012-02-08 17:50:20.000000000 +0100 @@ -72,11 +72,11 @@ } void perl_syck_error_handler(SyckParser *p, char *msg) { - croak(form( "%s parser (line %d, column %ld): %s", + croak("%s parser (line %d, column %ld): %s", "Syck", p->linect + 1, - p->cursor - p->lineptr, - msg )); + (long) (p->cursor - p->lineptr), + msg ); } void perl_syck_output_handler(SyckEmitter *e, char *str, long len) {
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-17364-1328948772-1372.74785-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 131
Download (untitled) / with headers
text/plain 131b


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.