aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--char.c6
-rw-r--r--tokenize.c3
-rw-r--r--validation/escapes.c2
-rw-r--r--validation/preprocessor/early-escape.c1
4 files changed, 7 insertions, 5 deletions
diff --git a/char.c b/char.c
index e3f6a006..e2b3863b 100644
--- a/char.c
+++ b/char.c
@@ -54,7 +54,13 @@ static const char *parse_escape(const char *p, unsigned *val, const char *end, i
break;
}
default: /* everything else is left as is */
+ warning(pos, "unknown escape sequence: '\\%c'", c);
break;
+ case '\\':
+ case '\'':
+ case '"':
+ case '?':
+ break; /* those are legal, so no warnings */
}
*val = c & ~((~0U << (bits - 1)) << 1);
return p;
diff --git a/tokenize.c b/tokenize.c
index f93ce46f..632413f0 100644
--- a/tokenize.c
+++ b/tokenize.c
@@ -615,9 +615,6 @@ static int eat_string(int next, stream_t *stream, enum token_type type)
want_hex = 0;
escape = next == '\\';
} else {
- if (!(cclass[next + 1] & Escape))
- warning(stream_pos(stream),
- "Unknown escape '%c'", next);
escape = 0;
want_hex = next == 'x';
}
diff --git a/validation/escapes.c b/validation/escapes.c
index 5f526b9c..604a37d3 100644
--- a/validation/escapes.c
+++ b/validation/escapes.c
@@ -18,10 +18,10 @@ static char d_oct[3] = "\141";
* check-name: Character escape sequences
*
* check-error-start
-escapes.c:6:26: warning: Unknown escape 'c'
escapes.c:3:34: warning: hex escape sequence out of range
escapes.c:3:44: warning: hex escape sequence out of range
escapes.c:4:18: warning: hex escape sequence out of range
+escapes.c:6:24: warning: unknown escape sequence: '\c'
escapes.c:6:30: warning: multi-character character constant
escapes.c:6:39: warning: multi-character character constant
escapes.c:6:47: warning: hex escape sequence out of range
diff --git a/validation/preprocessor/early-escape.c b/validation/preprocessor/early-escape.c
index c7beba5d..5ca5e8f4 100644
--- a/validation/preprocessor/early-escape.c
+++ b/validation/preprocessor/early-escape.c
@@ -11,7 +11,6 @@
* for a token which is excluded by the preprocessor.
* check-name: early-escape
* check-command: sparse -E $file
- * check-known-to-fail
*
* check-output-start