[PATCH 2/2] Update the validation check for escape sequences

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Namhyung Kim
Date: Thursday, December 16, 2010 - 2:14 am

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 validation/escapes.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/validation/escapes.c b/validation/escapes.c
index b0d2b4b742c2..13f8f9c87e21 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
  */
-- 
1.7.3.3.400.g93cef

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] Fix tokenizer for octal escape sequences, Namhyung Kim, (Thu Dec 16, 2:14 am)
[PATCH 2/2] Update the validation check for escape sequences, Namhyung Kim, (Thu Dec 16, 2:14 am)