#ifndef _RE2C_CONF_MSG_
#define _RE2C_CONF_MSG_
+#include "src/util/attribute.h"
+
namespace re2c {
-void error (const char * fmt, ...);
+void error (const char * fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2)));
void error_encoding ();
void usage ();
void vernum ();
#include "src/globals.h"
#include "src/parse/input.h"
#include "src/parse/token.h"
+#include "src/util/attribute.h"
#include "src/util/forbid_copy.h"
#include "src/util/substr.h"
const std::string & get_fname () const;
void set_in_parse(bool new_in_parse);
void fatal_at(uint32_t line, uint32_t ofs, const char *msg) const;
- void fatalf_at(uint32_t line, const char*, ...) const;
- void fatalf(const char*, ...) const;
+ void fatalf_at(uint32_t line, const char*, ...) const RE2C_GXX_ATTRIBUTE ((format (printf, 3, 4)));
+ void fatalf(const char*, ...) const RE2C_GXX_ATTRIBUTE ((format (printf, 2, 3)));
void fatal(const char*) const;
void fatal(uint32_t, const char*) const;
--- /dev/null
+#ifndef _RE2C_UTIL_ATTRIBUTE_
+#define _RE2C_UTIL_ATTRIBUTE_
+
+#ifdef __GNUC__
+# define RE2C_GXX_ATTRIBUTE(x) __attribute__(x)
+#else
+# define RE2C_GXX_ATTRIBUTE(x)
+#endif
+
+#endif // _RE2C_UTIL_ATTRIBUTE_