aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/preprocessor
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-07 17:20:10 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-09 16:14:16 +0100
commitb7f05bc01b1b61359e3f7e41b504e763e5a9880b (patch)
tree0db2f6f40ad5ceea42bbf5bc2686fe10108ea5df /validation/preprocessor
parent485700db8ffc3fe0cba6cd8464eef020da18bc53 (diff)
downloadsparse-dev-b7f05bc01b1b61359e3f7e41b504e763e5a9880b.tar.gz
don't allow newlines inside string literals
Sparse allows (but warns about) a bare newline (not preceded by a backslash) inside a string. Since this is invalid C, it's probable that a terminating '"' is missing just before the newline. In this case, allowing the newline implies accepting the following characters until the next '"' is found, which is most case creates a lot of irrelevant warnings. Change this by disallowing newlines inside strings, exactly like already done for character constants. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/preprocessor')
-rw-r--r--validation/preprocessor/missing-delim.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/validation/preprocessor/missing-delim.c b/validation/preprocessor/missing-delim.c
index 3763520b..60957fb9 100644
--- a/validation/preprocessor/missing-delim.c
+++ b/validation/preprocessor/missing-delim.c
@@ -9,10 +9,9 @@ extern void foo(void);
* check-name: missing-delim
* check-command: sparse -E $file
* check-output-ignore
- * check-known-to-fail
*
* check-error-start
-preprocessor/missing-delim.c:2:0: warning: missing delimitator '
-preprocessor/missing-delim.c:4:0: warning: missing delimitator "
+preprocessor/missing-delim.c:2:0: warning: missing terminating ' character
+preprocessor/missing-delim.c:4:0: warning: missing terminating " character
* check-error-end
*/