aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/evaluate.c
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-08-18 21:59:00 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-08-18 21:59:00 +0200
commitbdcf20485487a685b0b21230d2455f992793c272 (patch)
tree5cdaf23b5cf08aa6a45908b5866b1ce02a3e15bf /evaluate.c
parentaa6ede3b4d9de68b071481be22071fc4d5dff282 (diff)
parent437aaeabe6f148825c1e7abd36a6a98b5b2244ae (diff)
downloadsparse-bdcf20485487a685b0b21230d2455f992793c272.tar.gz
Merge branch 'past-deep'
* conditionalize warning "advancing past deep designator"
Diffstat (limited to 'evaluate.c')
-rw-r--r--evaluate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/evaluate.c b/evaluate.c
index 447020aa..4814a6d5 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -2616,7 +2616,7 @@ static void handle_list_initializer(struct expression *expr,
int class, struct symbol *ctype, unsigned long mods)
{
struct expression *e, *last = NULL, *top = NULL, *next;
- int jumped = 0;
+ int jumped = 0; // has the last designator multiple levels?
if (expr->zero_init)
free_ptr_list(&expr->expr_list);
@@ -2649,7 +2649,7 @@ static void handle_list_initializer(struct expression *expr,
ctype->ident ? ": " : "",
get_type_name(struct_sym->type),
show_ident(struct_sym->ident));
- if (jumped) {
+ if (jumped && Wpast_deep_designator) {
warning(e->pos, "advancing past deep designator");
jumped = 0;
}