[Bug,default/25661] incorrect handling of anonymous struct/union fields
Commit Message
https://sourceware.org/bugzilla/show_bug.cgi?id=25661
--- Comment #2 from dodji at redhat dot com ---
Here is what the code of the dodji/PR25661 branch does so far, on the example
submitted in this problem report:
$ diff -u test5-v0.c test5-v1.c
$ build/tools/abidiff test5-v0.o test5-v1.o
Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added
function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
$ abidiff --harmless test5-v0.o test5-v1.o
Functions changes summary: 0 Removed, 1 Changed, 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
1 function with some indirect sub-type change:
[C] 'function void func(S*)' at test5-v1.c:18:1 has some indirect sub-type
changes:
parameter 1 of type 'S*' has sub-type changes:
in pointed to type 'struct S' at test5-v1.c:3:1:
type size hasn't changed
data members 'S::a', 'S::marker', 'S::b' were replaced by anonymous
data member:
'union {uint64_t marker[]; struct {uint64_t a; uint64_t b;};}'
$
@@ -2,9 +2,15 @@
struct S
{
- uint64_t marker[0];
- uint64_t a;
- uint64_t b;
+ union
+ {
+ uint64_t marker[0];
+ struct
+ {
+ uint64_t a;
+ uint64_t b;
+ };
+ };
uint64_t c;
};