source: CIVL/mods/dev.civl.abc/examples/link/a_0.c

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 678 bytes
Line 
1/* a_0.c. To be linked with a_1.c and a_2.c. In this translation
2 * unit, struct S is complete.
3 *
4 * By the end of the linking process, the functions will have the
5 * following types:
6 *
7 * f: pointer to struct S {int x;} -> int
8 * h: pointer to struct S {double y;} -> void
9 *
10 * However, h may not have this type until after its body is analyzed.
11 * So after analysis, if a function's type has changed, need to go
12 * back and re-analyze. If you did that you would get an error when
13 * re-analyzing the body of h at the "f(p)", because the type of p
14 * would be incompatible with the type expected by f.
15 */
16struct S {int x;};
17int f(struct S *p) {
18 return p->x + 1;
19}
Note: See TracBrowser for help on using the repository browser.