History

use static declaration from prototype

static int func(); ... int func() { } As result, func needs to be static.

grischka committed 17 years ago

Commit a342bba1 parent 69fdb571 file · +8 −3Browse files

Unified · Split

tccgen.c+8−3
@@ -5032,16 +5032,21 @@ static void decl(int l) · 5031 unmodified lines
50325032 if (sym) {
50335033 if ((sym->type.t & VT_BTYPE) != VT_FUNC)
50345034 goto func_error1;
5035− /* specific case: if not func_call defined, we put
5036− the one of the prototype */
5037− /* XXX: should have default value */
5035+
50385036 r = sym->type.ref->r;
5037+ /* use func_call from prototype if not defined */
50395038 if (FUNC_CALL(r) != FUNC_CDECL
50405039 && FUNC_CALL(type.ref->r) == FUNC_CDECL)
50415040 FUNC_CALL(type.ref->r) = FUNC_CALL(r);
5041+
5042+ /* use export from prototype */
50425043 if (FUNC_EXPORT(r))
50435044 FUNC_EXPORT(type.ref->r) = 1;
50445045
5046+ /* use static from prototype */
5047+ if (sym->type.t & VT_STATIC)
5048+ type.t = (type.t & ~VT_EXTERN) | VT_STATIC;
5049+
50455050 if (!is_compatible_types(&sym->type, &type)) {
50465051 func_error1:
50475052 error("incompatible types for redefinition of '%s'",

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