-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtbool-aliasing.c
More file actions
53 lines (42 loc) · 862 Bytes
/
tbool-aliasing.c
File metadata and controls
53 lines (42 loc) · 862 Bytes
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
struct bufr {
char pr_buf[4096];
};
struct a {
bool error;
struct bufr pr_buf;
};
struct status {
int flags;
int input;
float delay;
char data[32];
};
static void
rdec(void *s)
{
struct status *p = s;
printf("%d\n", p->input);
p->input = 1;
printf("%d\n", p->input);
return;
}
int
main(void)
{
struct a *a = calloc((size_t) 1, sizeof(*a));
rdec(&a->pr_buf);
printf("&a->error = %p\n", &a->error);
printf("&a->pr_buf = %p\n", &a->pr_buf);
printf("&a->pr_buf.pr_buf = %p\n", &a->pr_buf);
free(a);
return 0;
}
/*
* Local Variables:
* eval: (make-local-variable 'compile-command)
* compile-command: (let ((fn (file-name-sans-extension (file-name-nondirectory (buffer-file-name))))) (concat "rm -f " fn "; " (default-value 'compile-command) " " fn " && ./" fn))
* End:
*/