Fixed constness of bit-fields.

This commit is contained in:
acqn
2023-11-29 12:27:01 +08:00
parent 5537b61e6a
commit 6434176909
4 changed files with 19 additions and 4 deletions

View File

@@ -0,0 +1,14 @@
/* Bug #2018 - Compiler has problems with const struct fields */
typedef union U {
int a : 16;
const int b : 16;
} U;
int main(void)
{
U x = { 42 };
x.b = 0;
return 0;
}