summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2015-10-16 18:00:44 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2015-10-16 18:20:37 -0400
commit2fc2b82963a5f0e3e212a447c223b2e7bcb5e5e5 (patch)
treea126081ec302cf22370a1d27a58612833eea1b85 /Source/Core/VideoCommon
parent5380fd9dba1feb1f6efed40d3f9c007179a5a4e9 (diff)
VideoCommon: teach gcc to type-check the arguments fed to Write()
Note that the "this" implicit argument counts as 1, which is why all the printf arguments are shifted over one.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/ShaderGenCommon.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/ShaderGenCommon.h b/Source/Core/VideoCommon/ShaderGenCommon.h
index 2fd6c51819..ece50e6c38 100644
--- a/Source/Core/VideoCommon/ShaderGenCommon.h
+++ b/Source/Core/VideoCommon/ShaderGenCommon.h
@@ -32,8 +32,11 @@ public:
* Can be used like printf.
* @note In the ShaderCode implementation, this does indeed write the parameter string to an internal buffer. However, you're free to do whatever you like with the parameter.
*/
- template<typename... Args>
- void Write(const char*, Args...) {}
+ void Write(const char*, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 3)))
+#endif
+ {}
/*
* Returns a read pointer to the internal buffer.
@@ -116,6 +119,9 @@ public:
}
void Write(const char* fmt, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 3)))
+#endif
{
va_list arglist;
va_start(arglist, fmt);