Skip to contentSkip to conversation

label_statement ambiguity in parse.h

DISCUSSION Yoann Padioleau 1 participant 1 message Dec 4, 2008 Sparse checker

lore
Share & tools
lore
#0 lore raw

In parse.h 'struct statement' the same fieldname "label_statement" is used multiple times. Is it intended ?

struct statement {
	enum statement_type type;
	struct position pos;
	union {
		struct /* declaration */ {
			struct symbol_list *declaration;
		};
		struct /* label_arg */ {
			struct symbol *label;
==> HERE		struct statement *label_statement;
		};
                ...
		struct /* labeled_struct */ {
			struct symbol *label_identifier;
==> HERE		struct statement *label_statement;
		};

I guess from the gcc point of view it does not make a difference as it will point to the same address because in both cases the items before have the same type and so size, but if one day someone change one type, the user may have some surprise ?