summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-10-01 22:44:14 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-30 14:05:03 +0100
commitb187d1bbd61f49fd8008be7091a13df5600bcea6 (patch)
tree8c15b3bf683ae4e7c40112e1e991f4c7c6bcf73d
parent63d2c3d5f7c6e3684f164a6959ceb5986595ba42 (diff)
downloadsparse-b187d1bbd61f49fd8008be7091a13df5600bcea6.tar.gz
bitfield: keep the bitfield ident
While issuing a diagnostic related to a bitfield, it's useful to display the bitfield's name. Unfortunately, this name is not stored in the symbol and thus is only available during parsing. Fix this by adding the ident to the symbol initialization. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--parse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index 6db3cba7..efd8c5de 100644
--- a/parse.c
+++ b/parse.c
@@ -1972,6 +1972,7 @@ static struct token *handle_bitfield(struct token *token, struct decl_state *ctx
}
bitfield->bit_size = width;
bitfield->endpos = token->pos;
+ bitfield->ident = *ctx->ident;
return token;
}