Closed dopelsunce closed 3 years ago
We definitely don't want to be rewriting those.
It looks like clang
is folding constants before we even get our hands on the AST, so all we see is
|-VarDecl 0x55da5b541ee8 <h.c:1:1, col:14> col:6 a 'char [9]'
`-VarDecl 0x55da5b5420b8 <line:2:1, col:26> col:6 b 'char [120]'
This means the fix will be some finicky rewriting logic. Instead of clobbering the declaration, we'll need to carefully insert Checked
where it's needed.
Here's a more general example that shows what's happening.
char c[1 /*a very important comment*/];
is rewritten to
char c _Checked[1];
Wow this a big one. Seems like this is pushing for a larger re-do of rewriting ...
Hi, here is the issue we talked about briefly in the meeting.
foo.c
Returns:
Wanted:
It might be best to keep the constant expression as is.