* src/complain.h, src/complain.c (deprecated_directive): New.
* src/muscle-tab.c: Use it.
#include "complain.h"
#include "files.h"
#include "getargs.h"
+#include "quote.h"
warnings warnings_flag =
Wconflicts_sr | Wconflicts_rr | Wdeprecated | Wother;
complain (loc, fatal, "too many arguments for complains");
break;
}
+
+}
+
+void
+deprecated_directive (location const *loc, char const *old, char const *upd)
+{
+ if (feature_flag & feature_caret)
+ complain (loc, Wdeprecated,
+ _("deprecated directive, use %s"),
+ quote_n (1, upd));
+ else
+ complain (loc, Wdeprecated,
+ _("deprecated directive: %s, use %s"),
+ quote (old), quote_n (1, upd));
}
__attribute__ ((__format__ (__printf__, 4, 5)));
+/** Report an obsolete syntax, suggest the updated one. */
+void deprecated_directive (location const *loc,
+ char const *obsolete, char const *updated);
+
/** Warnings treated as errors shouldn't stop the execution as regular errors
should (because due to their nature, it is safe to go on). Thus, there are
three possible execution statuses. */
#define DEPRECATED(Msg) \
do { \
size_t i; \
- complain (loc, Wdeprecated, \
- _("deprecated directive: %s, use %s"), \
- quote (yytext), quote_n (1, Msg)); \
+ deprecated_directive (loc, yytext, Msg); \
scanner_cursor.column -= mbsnwidth (Msg, strlen (Msg), 0); \
for (i = strlen (Msg); i != 0; --i) \
unput (Msg[i - 1]); \