File: struct4.c

package info (click to toggle)
chibicc 1.0.23.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,832 kB
  • sloc: ansic: 62,911; sh: 275; makefile: 92
file content (27 lines) | stat: -rw-r--r-- 416 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stddef.h>
#include "test.h"

typedef unsigned char u8;
struct S
{
  u8 a,b;
  u8 c[2];
};

struct U
{
  u8 a;
  struct S s;
  u8 b;
};
struct U gu = {3, 5,6,7,8, 4};

int main()
{
  printf("%ld\n", sizeof(struct U));
  ASSERT(6, sizeof(struct U));
  printf("%ld\n", sizeof(gu));
  ASSERT(6, sizeof(gu));
  ({ struct { struct { int a; struct { int b; }; }; int c; } x={1,2,3,.b=4,5}; x.c; });
  return 0;
}