History

Accept extern initialized file-scope variables

'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.

Michael Matz committed 9 years ago

Commit 94ac9f21 parent 5732a182 files · +4 −1Browse files

Showing the changes to tests (1 of 2 files). Show all

Unified · Split

tests/tcctest.c+2−0
@@ -1752,6 +1752,8 @@ arrtype2 sinit22 = {5,6,7}; · 1751 unmodified lines
17521752 int sinit23[2] = { "astring" ? sizeof("astring") : -1,
17531753 &sinit23 ? 42 : -1 };
17541754
1755+extern int external_inited = 42;
1756+
17551757 void init_test(void)
17561758 {
17571759 int linit1 = 2;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t