aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorNamhyung Kim <namhyung@gmail.com>2010-12-16 18:14:46 +0900
committerChristopher Li <sparse@chrisli.org>2011-01-03 02:21:08 -0800
commit192f7b224271c8e7026f8c91edf7cbe8c949a83f (patch)
tree697c955e8856cb5dcb77b62675e8186311abb26c /validation
parent19de6512c98edec3f2e09eea1aa0bc94ae762709 (diff)
downloadsparse-dev-192f7b224271c8e7026f8c91edf7cbe8c949a83f.tar.gz
Update the validation check for escape sequences
Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
-rw-r--r--validation/escapes.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/validation/escapes.c b/validation/escapes.c
index b0d2b4b7..13f8f9c8 100644
--- a/validation/escapes.c
+++ b/validation/escapes.c
@@ -1,6 +1,21 @@
static int e[] = { '\'', '\"', '\?', '\\',
- '\a', '\b', '\f', '\n', '\r', '\t', '\v', };
-static char *s = "\'\"\?\\ \a\b\f\n\r\t\v";
+ '\a', '\b', '\f', '\n', '\r', '\t', '\v',
+ '\0', '\012', '\x7890', '\xabcd' };
+static char *s = "\'\"\?\\ \a\b\f\n\r\t\v \377\xcafe";
+
+static int bad_e[] = { '\c', '\0123', '\789', '\xdefg' };
/*
* check-name: Character escape sequences
+ *
+ * check-error-start
+escapes.c:6:27: warning: Unknown escape 'c'
+escapes.c:6:35: error: Bad character constant
+escapes.c:6:38: error: Bad character constant
+escapes.c:6:42: error: Bad character constant
+escapes.c:6:46: error: Bad character constant
+escapes.c:6:53: error: Bad character constant
+escapes.c:6:56: error: Bad character constant
+escapes.c:6:42: error: Expected } at end of initializer
+escapes.c:6:42: error: got 89
+ * check-error-end
*/