[PATCH] RFC: remove warning "advancing past deep designator"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux