struct-init: Cleanup

Remove dead code and variables.  Properly check for unions when
skipping fields in initializers.  Make tests2/*.expect depend
on the .c files so they are automatically rebuilt when the latter
change.
This commit is contained in:
Michael Matz
2016-07-31 06:18:45 +02:00
parent ed7d54651d
commit 7bf323843e
4 changed files with 25 additions and 103 deletions

View File

@ -67,6 +67,16 @@ struct V gv3 = {((struct S){7,8,{9,10}}), {"hoho", 49}, 50};
/* Initialization of a flex array member (warns in GCC) */
struct W gw = {{1,2,3,4}, {1,2,3,4,5}};
union UU {
u8 a;
u8 b;
};
struct SU {
union UU u;
u8 c;
};
struct SU gsu = {5,6};
#include <stdio.h>
void print_ (const char *name, const u8 *p, long size)
{
@ -133,6 +143,7 @@ int main()
print(gv3);
print(sinit16);
print(gw);
print(gsu);
foo(&gw);
//printf("q: %s\n", q);
return 0;