This is a temporary (and quite inconvenient) hack; in fact,
warnings should be handled in the same way as options (via
user config / real config that are synced on each read access
just in case user config has been changed).
void warning_start (uint32_t line, bool error)
{
- static const char * msg = error ? "error" : "warning";
+ const char * msg = error ? "error" : "warning";
fprintf (stderr, "re2c: %s: line %u: ", msg, line);
}
default:
break;
}
- if (tags) {
- warn.set(Warn::NONDETERMINISTIC_TAGS, Warn::WERROR);
- }
if (bFlag)
{
sFlag = true;
#include "src/conf/warn.h"
#include "src/ir/skeleton/path.h"
#include "src/ir/skeleton/skeleton.h"
+#include "src/globals.h"
namespace re2c {
{
if (mask[NONDETERMINISTIC_TAGS] & WARNING)
{
- const bool e = mask[NONDETERMINISTIC_TAGS] & ERROR;
+ bool e = mask[NONDETERMINISTIC_TAGS] & ERROR;
+
+ // a very bad hack to temporarily turn on -Werror
+ // TODO: userwarn/realwarn (like useropt/realopt)
+ if (opts->tags) {
+ e = true;
+ }
+
error_accuml |= e;
if (tagname == NULL) {