Subject: | compilation fails with -Werror=format-security |
attached patch fixes the problem.
Subject: | Tcl-1.02-fmt_error.patch |
--- Tcl.xs.orig 2012-07-09 10:45:04.635579689 +0200
+++ Tcl.xs 2012-07-09 10:45:33.432580876 +0200
@@ -213,7 +213,7 @@
#if !defined(WIN32) && !defined(__hpux)
char *error = dlerror();
if (error != NULL) {
- warn(error);
+ warn("%s",error);
}
#endif
warn("NpLoadLibrary: could not find Tcl library at '%s'", dl_path);
@@ -399,7 +399,7 @@
#if !defined(WIN32) && !defined(__hpux)
char *error = dlerror();
if (error != NULL) {
- warn(error);
+ warn("%s",error);
}
#endif
return TCL_ERROR;
@@ -785,7 +785,7 @@
else {
if (count != 1) {
croak("Perl sub bound to Tcl proc returned %d args, expected 1",
- count);
+ (int)count);
}
sv = POPs; /* pop the undef off the stack */
@@ -865,7 +865,7 @@
else {
if (count != 1) {
croak("Perl sub bound to Tcl proc returned %d args, expected 1",
- count);
+ (int)count);
}
sv = POPs; /* pop the undef off the stack */
@@ -1029,7 +1029,7 @@
/* sv_mortalcopy here prevents stringifying script - necessary ?? */
cscript = SvPV(sv_mortalcopy(script), length);
if (Tcl_EvalEx(interp, cscript, length, flags) != TCL_OK) {
- croak(Tcl_GetStringResult(interp));
+ croak("%s", Tcl_GetStringResult(interp));
}
prepare_Tcl_result(aTHX_ interp, "Tcl::Eval");
SPAGAIN;
@@ -1092,7 +1092,7 @@
PUTBACK;
Tcl_ResetResult(interp);
if (Tcl_EvalFile(interp, filename) != TCL_OK) {
- croak(Tcl_GetStringResult(interp));
+ croak("%s", Tcl_GetStringResult(interp));
}
prepare_Tcl_result(aTHX_ interp, "Tcl::EvalFile");
SPAGAIN;
@@ -1117,7 +1117,7 @@
{
Tcl_ResetResult(interp);
if (Tcl_Eval(interp, s) != TCL_OK)
- croak(Tcl_GetStringResult(interp));
+ croak("%s",Tcl_GetStringResult(interp));
append = 0;
}
}
@@ -1251,7 +1251,7 @@
}
if (result != TCL_OK) {
- croak(Tcl_GetStringResult(interp));
+ croak("%s", Tcl_GetStringResult(interp));
}
prepare_Tcl_result(aTHX_ interp, "Tcl::invoke");
@@ -1318,7 +1318,7 @@
}
if (result != TCL_OK) {
- croak(Tcl_GetStringResult(interp));
+ croak("%s", Tcl_GetStringResult(interp));
}
prepare_Tcl_result(aTHX_ interp, "Tcl::icall");
@@ -1393,7 +1393,7 @@
CODE:
if (!initialized) { return; }
if (tclKit_AppInit(interp) != TCL_OK) {
- croak(Tcl_GetStringResult(interp));
+ croak("%s", Tcl_GetStringResult(interp));
}
Tcl_CreateObjCommand(interp, "::perl::Eval", Tcl_EvalInPerl,
(ClientData) NULL, NULL);