'extern int i = 42;' at file scope (but not in function scope!) is allowed and is a proper definition, even though questionable style; some compilers warn about this.
Showing the changes to tests (1 of 2 files). Show all
Unified · Split
| @@ -1752,6 +1752,8 @@ arrtype2 sinit22 = {5,6,7}; · 1751 unmodified lines | ||
| 1752 | 1752 | int sinit23[2] = { "astring" ? sizeof("astring") : -1, |
| 1753 | 1753 | &sinit23 ? 42 : -1 }; |
| 1754 | 1754 | |
| 1755 | +extern int external_inited = 42; | |
| 1756 | + | |
| 1755 | 1757 | void init_test(void) |
| 1756 | 1758 | { |
| 1757 | 1759 | int linit1 = 2; |