From 66b920f03192652c5b0e80b2ac16624c3f5c03b1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 6 Jan 2014 11:55:13 -0800 Subject: [PATCH] Don't cast the pointer in STAP_RETVALUE:string If the embedded C author uses the wrong pointer type, the compiler should rightly complain about it when passed to strlcpy. In the rare case a cast is truly needed, it should be manually added. --- translate.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translate.cxx b/translate.cxx index 04e753ed3..7ef4c86e0 100644 --- a/translate.cxx +++ b/translate.cxx @@ -2128,7 +2128,7 @@ c_unparser::emit_function (functiondecl* v) case pe_string: o->newline() << - "#define STAP_RETURN(v) do { strlcpy(STAP_RETVALUE, (const char*) (v), MAXSTRINGLEN); " + "#define STAP_RETURN(v) do { strlcpy(STAP_RETVALUE, (v), MAXSTRINGLEN); " "goto out; } while(0)"; break; -- 2.43.5