From: Ingo Ruhnke Date: Sun, 31 Aug 2014 19:41:23 +0000 (+0200) Subject: Fixed format string warning in clang X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=67d91f9e8ed0fe5194427889abb3674a757293f4;p=supertux.git Fixed format string warning in clang --- diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index a70f2fda0..4efac9abe 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -39,12 +39,15 @@ HSQREMOTEDBG debugger = NULL; namespace { -void printfunc(HSQUIRRELVM, const char* str, ...) +#ifdef __clang__ +__attribute__((__format__ (__printf__, 2, 0))) +#endif +void printfunc(HSQUIRRELVM, const char* fmt, ...) { char buf[4096]; va_list arglist; - va_start(arglist, str); - vsnprintf(buf, sizeof(buf), str, arglist); + va_start(arglist, fmt); + vsnprintf(buf, sizeof(buf), fmt, arglist); ConsoleBuffer::output << (const char*) buf << std::flush; va_end(arglist); }