projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f26e6c
)
Fixed format string warning in clang
author
Ingo Ruhnke
<grumbel@gmail.com>
Sun, 31 Aug 2014 19:41:23 +0000
(21:41 +0200)
committer
Ingo Ruhnke
<grumbel@gmail.com>
Sun, 31 Aug 2014 19:49:05 +0000
(21:49 +0200)
src/scripting/scripting.cpp
patch
|
blob
|
history
diff --git
a/src/scripting/scripting.cpp
b/src/scripting/scripting.cpp
index
a70f2fd
..
4efac9a
100644
(file)
--- 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);
}