diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-06-03 18:46:37 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-06-04 09:55:57 -0700 |
commit | 0153035f93d5e537efef9119676e120034ac912b (patch) | |
tree | 76900730542405bb635647ea60bdc1854849c6ec /lib | |
parent | 762bd0aa660b0c1c02597e0d2e5c5fbf9bab1b91 (diff) | |
download | gnulib-0153035f93d5e537efef9119676e120034ac912b.tar.gz |
dfa: do not warn about \] and \}
* lib/dfa.c (lex): Do not warn about \] and \}, since they’re
surely universally supported even though POSIX says their
interpretation is undefined.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dfa.c | 2 | ||||
-rw-r--r-- | lib/dfa.h | 6 |
2 files changed, 7 insertions, 1 deletions
@@ -1563,6 +1563,8 @@ lex (struct dfa *dfa) } dfawarn (msg); } + FALLTHROUGH; + case ']': case '}': normal_char: dfa->lex.laststart = false; /* For multibyte character sets, folding is done in atom. Always @@ -79,7 +79,11 @@ enum merely a warning. */ DFA_CONFUSING_BRACKETS_ERROR = 1 << 2, - /* Warn about stray backslashes before ordinary characters. */ + /* Warn about stray backslashes before ordinary characters other + than ] and } which are special because even though POSIX + says \] and \} have undefined interpretation, platforms + reliably ignore those stray backlashes and warning about them + would likely cause more trouble than it's worth. */ DFA_STRAY_BACKSLASH_WARN = 1 << 3, /* Warn about * appearing out of context at the start of an |