expression: recognize references to labels as address constants
RFC PATCH 8/13 expression: recognize references to labels as address constants
As an extension, GCC allows labels to be referenced a la
label1:
...
void *ptr = &&label1;
Tag these label references as being address constants allowing them to be used as initializers for objects of static storage duration.
Signed-off-by Nicolai Stange <[email protected]>
--- expression.c | 2 ++ 1 file changed, 2 insertions(+)
expression.c +2 -0
@@ -684,6 +684,8 @@ static struct token *unary_expression(struct token *token, struct expression **t sym->ctype.modifiers |=MOD_ADDRESSABLE ;add_symbol (&function_computed_target_list, sym); } + label->flags |= +expr_set_flag_mask (EXPR_FLAG_ADDR_CONST_EXPR ); label->label_symbol = sym; *tree = label;return token->next->next;
Signature · 1 line
2.4.5