From dc5e56c2f3b2d8dd1982aa3c848bc48946de2f1b Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 24 Oct 2015 00:53:03 +0100 Subject: [PATCH] Add GCC printf format check to _glfwInputError This allows it to print a warning whenever _glfwInputError format specifiers aren't used correctly. Closes #622. --- src/internal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/internal.h b/src/internal.h index 56647a31..625dea00 100644 --- a/src/internal.h +++ b/src/internal.h @@ -784,7 +784,11 @@ void _glfwInputMonitorChange(void); * description. * @ingroup event */ -void _glfwInputError(int error, const char* format, ...); +void _glfwInputError(int error, const char* format, ...) +#ifdef __GNUC__ +__attribute__((format(printf, 2, 3))) +#endif +; /*! @brief Notifies dropped object over window. * @param[in] window The window that received the event.