-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.c
34 lines (31 loc) · 818 Bytes
/
example.c
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
28
29
30
31
32
33
34
/* #include <sys/dir.h> */
/* example.c */
/* (tentative) definitions */
/* static c; extern c; */
/* static int c = 3; */
/* static int c; */
/* /\* old style function definition *\/ */
/* void* match(s_ix, l_ix, pat) */
/* long l_ix; */
/* char unsigned *pat; */
/* { exit(1); } */
/* /\* typedefs and structs *\/ */
/* typedef struct s { struct { char chr; double dbl; } x,*y; } __attribute__((packed)) S; */
/* struct t { int a; }; */
/* S f(); */
/* static g(S a) { return 0; } */
/* int main() { printf("%d",sizeof(DIR)); } */
typedef enum { Angstrom, Mile, Kilometre, Lightyear } Distancetype;
typedef struct Distance Distance;
typedef struct Distance {
Distancetype tag;
union {
double angstorms;
double miles;
double kilometres;
struct {
double x;
double y;
} lightyear;
};
};