Add printf format attributes

When compiling with gcc, we already include the attribute on check_msg()
to give compiler warnings about mismatches between printf() like format
strings and the corresponding arguments.  This patch adds similar
attributes for lexical_error() and die().

Suggested-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
diff --git a/dtc-lexer.l b/dtc-lexer.l
index c600603..52bed7b 100644
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -62,7 +62,13 @@
 
 static void push_input_file(const char *filename);
 static bool pop_input_file(void);
+#ifdef __GNUC__
+static void lexical_error(const char *fmt, ...)
+	__attribute__((format (printf, 1, 2)));
+#else
 static void lexical_error(const char *fmt, ...);
+#endif
+
 %}
 
 %%