source:
CIVL/mods/dev.civl.com/examples/modelbuilder/block_scope_extern.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 173 bytes | |
| Line | |
|---|---|
| 1 | #include <assert.h> |
| 2 | |
| 3 | int f() { |
| 4 | int x = 0; // no linkage |
| 5 | |
| 6 | if (1 > 0) { |
| 7 | extern int x; |
| 8 | |
| 9 | assert(x == 9); |
| 10 | } |
| 11 | return x; |
| 12 | } |
| 13 | |
| 14 | int x = 9; |
| 15 | |
| 16 | int main() { |
| 17 | return f(); |
| 18 | } |
Note:
See TracBrowser
for help on using the repository browser.
