From: Josh Stone Date: Mon, 6 Jan 2014 19:55:13 +0000 (-0800) Subject: Don't cast the pointer in STAP_RETVALUE:string X-Git-Tag: release-2.5~368 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=66b920f03192652c5b0e80b2ac16624c3f5c03b1;p=systemtap.git 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. --- 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;