summaryrefslogtreecommitdiff
path: root/05/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-02-03 19:19:12 -0500
committerpommicket <pommicket@gmail.com>2022-02-03 19:19:12 -0500
commit3e6cacfb7c57fc8b6969c5939e88ba75089c0161 (patch)
treef2e31adcdd50fce6fad3dddac1ea1b98e4f7aab0 /05/main.c
parent04c5e1af8a03cb943acbebcb7460193c8bd37a26 (diff)
parsing C is annoying
Diffstat (limited to '05/main.c')
-rw-r--r--05/main.c107
1 files changed, 55 insertions, 52 deletions
diff --git a/05/main.c b/05/main.c
index 34be337..6a9af7f 100644
--- a/05/main.c
+++ b/05/main.c
@@ -1,54 +1,57 @@
-/*typedef struct {
+typedef struct {
int i[41];
long double d;
-} (*x)(void);
-
-/* typedef enum X { */
-/* R,S,T */
-/* } *Foo[sizeof(unsigned long)]; */
-/* typedef int A[T]; */
-/* */
-/* typedef struct A { */
-/* int x, y; */
-/* long double c; */
-/* unsigned long d; */
-/* char e[3]; */
-/* long f; */
-/* } A; */
-/* */
-/* typedef union B{ */
-/* int x; */
-/* struct { */
-/* int y; */
-/* struct {long z; } c; */
-/* } c; */
-/* }B; */
-/* */
-/* 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"; */
-/* static char u[8] = "hellothe"; */
-/* static char v[100] = "re my"; */
-/* static char w[] = "friendly"; */
-/* static char x_[] = "hi"; */
-/* 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 char __b[][7] = {{'a'},"hello",'r'}; */
-/* static int _u = sizeof __b; */
-
-/* struct { */
-/* int a; */
-/* long b; */
-/* } x1[] = {0x1234567890, 1ul<<60|1ul<<3, 77}; */
-/* int y1 = 0x12345678; */
-typedef int R[sizeof *(int*)"hello"];
-
-/* struct { */
-/* int x[2], y; */
-/* } test = {3, 5}; */
-/* unsigned marker = 0xdeadbeef; */
+} (*x___)(void);
+
+typedef enum X {
+ R,S,T
+ } *Foo[sizeof(unsigned long)];
+typedef int A___[T];
+
+typedef struct A {
+ int x, y;
+ long double c;
+ unsigned long d;
+ char e[3];
+ long f;
+} A;
+
+typedef union B{
+ int x;
+ struct {
+ int y;
+ struct {long z; } c;
+ } c;
+}B;
+
+typedef int QQQ[sizeof(A)+sizeof"hello"];
+typedef int RRR[sizeof(struct B)];
+
+static unsigned int x={55};
+static char *s = "hello";
+static char *t = "goodbye";
+static char u[8] = "hellothe";
+static char v[100] = "re my";
+static char w[] = "friendly";
+static char x_[] = "hi";
+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 char __b[][7] = {{'a'},"hello",'r'};
+static int _u = sizeof __b;
+
+struct {
+ int a;
+ long b;
+} x1[] = {0x1234567890, 1ul<<60|1ul<<3, 77};
+int y1 = 0x12345678;
+
+struct {
+ int x[2], y;
+} test[] = {3, 5,0x1234,0x4321};
+typedef int Blah[sizeof((B *)0)->c.y];
+unsigned marker = 0xdeadbeef;
+
+
+/* typedef int X[sizeof(int)+4]; */