Philipp Klaus Krause schreef op 2025-10-22 18:29:
Dear SDCC users,
SDCC currently allows unnamed struct/union members that are neither
bit-fields nor anonymous struct/union, e.g.
struct v { char; };
This is not allowed in standard C (neither C99 nor C23, didn't check
other standard versions, but the C99 rationale doesn't mention it, so
this isn't new in C99).
The standard requires a diagnostic here. Is anyone using this feature?
If yes, I might make that diagnostic a warning; otherwise, I'd just
remove support and make it an error.
Philipp
How about this to reserve 2 bytes in a union?
union u { struct {int b0:1;}; int; };
Though nothing prevents giving the int a name and not referencing it.
Or to add an (unnamed) dummy bitfield for filling up.
I'm not against making it an error.
Maarten
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user