summaryrefslogtreecommitdiff
path: root/05/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-02-02 14:07:08 -0500
committerpommicket <pommicket@gmail.com>2022-02-02 14:07:08 -0500
commit2a65d49d59918527ae32096b2094d09d62918730 (patch)
treee2803bf15b11a4178f553ea8ceb8e4b976d82ee0 /05/main.c
parent6ccef91d521fc077fa297a1d692eb829c1926a81 (diff)
union initializers, fix bug with array initializers
Diffstat (limited to '05/main.c')
-rw-r--r--05/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/05/main.c b/05/main.c
index 6fb4a76..35d7917 100644
--- a/05/main.c
+++ b/05/main.c
@@ -26,7 +26,7 @@
/* */
/* typedef int x[sizeof(A)+sizeof"hello"]; */
/* typedef int y[sizeof(struct B)]; */
-
+/* */
static unsigned int x={55};
static char *s = "hello";
static char *t = "goodbye";
@@ -38,4 +38,12 @@ typedef int A[sizeof x_ + sizeof u];
static int a[5] = {1,2,3};
static char b[6][7] = {{'a'},{'b'},{'c'},{'d'},{'e'}};
-static int _u = 0x12345678;
+static char __b[][7] = {{'a'},"hello",'r'};
+static int _u = sizeof __b;
+
+union {
+ int a;
+ long b;
+} x1[3] = {0x1234567890, 1ul<<60|1ul<<3, 77};
+int y1 = 0x12345678;
+typedef int R[sizeof x1];