linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RFC: remove warning "advancing past deep designator"
@ 2017-05-19 13:58 Luc Van Oostenryck
  0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2017-05-19 13:58 UTC (permalink / raw)
  To: linux-sparse; +Cc: Christopher Li, Luc Van Oostenryck, Al Viro

This warning is issued in code like:
	struct s {
		union {
			int  i;
			long l;
		} u;
		int b;
	};
	static struct s s = {
		.u.i = 1,
		2,
	};
in other words, it is issued when a 'deep' designated initializer
is followed by a non-designated initializer.

I wonder what's really the value of this warning.
Is there really some confusion we would like to avoid?

NB. I'm not sure if this situation is covered by the standard
    (status of 'deep' designated initializers is not very clear).
NB. GCC accept this, without any option to warn about it.

CC: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 evaluate.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/evaluate.c b/evaluate.c
index f8ed10f13..ef4da2371 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -2501,10 +2501,6 @@ static void handle_list_initializer(struct expression *expr,
 					ctype->ident ? ": " : "",
 					get_type_name(struct_sym->type),
 					show_ident(struct_sym->ident));
-			if (jumped) {
-				warning(e->pos, "advancing past deep designator");
-				jumped = 0;
-			}
 			REPLACE_CURRENT_PTR(e, last);
 		} else {
 			next = check_designators(e, ctype);
-- 
2.13.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-19 13:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19 13:58 [PATCH] RFC: remove warning "advancing past deep designator" Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).