Message ID | 20170331014459.9351-17-luc.vanoostenryck@gmail.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
diff --git a/evaluate.c b/evaluate.c index 9a7d432b8..cdbc08ef2 100644 --- a/evaluate.c +++ b/evaluate.c @@ -108,6 +108,7 @@ static struct symbol *evaluate_string(struct expression *expr) addr->symbol = sym; addr->ctype = &lazy_ptr_ctype; + addr->flags = CEF_ADDR; expr->type = EXPR_PREOP; expr->op = '*'; diff --git a/validation/constexpr-string.c b/validation/constexpr-string.c new file mode 100644 index 000000000..e641a83eb --- /dev/null +++ b/validation/constexpr-string.c @@ -0,0 +1,9 @@ +static char *a = "foobar"; // OK + +/* + * check-name: string literal constness verification. + * check-command: sparse -Wconstexpr-not-const $file + * + * check-error-start + * check-error-end + */