aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-02-07 18:45:06 +0100
committerChristopher Li <sparse@chrisli.org>2017-02-13 09:34:45 +0800
commitf83c2b8f0b5fcb8f60342b5a2fa51a84901f355a (patch)
tree0a748cd0a58cf6736f596c63f6138573d785b690 /validation
parent4b81c44868bb0931464c48f9a6d776ffcd0515c1 (diff)
downloadsparse-dev-f83c2b8f0b5fcb8f60342b5a2fa51a84901f355a.tar.gz
warn on unknown escapes after preprocessing
Following the C standards conversion of escaped characters must be done after preprocessing, just before adjacent string concatenation. This is what is done but escape sequence were recognized already at tokenization phase and a warning is given then when an unknonw escape sequence was encountered. But there is no reason to give such warning at this earlier phase, manly because yhere is no reasons to warn on things which will be discarded during the preprocessing. Fix this by moving the diagnostic of unknown escape sequence together with the escape conversion. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
-rw-r--r--validation/escapes.c2
-rw-r--r--validation/preprocessor/early-escape.c1
2 files changed, 1 insertions, 2 deletions
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