scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 41765c098e17137abaa8f9e65858b4d03c99db47
parent 0e9ab695770b9c5501b56fb712527e1ed780950d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  9 Jan 2016 21:28:19 +0100

Mark as extern functions without storage class

When a function is defined the first time, if there is no
storage class then it is a symbol with extern linkage.

Diffstat:
Mcc1/decl.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -703,7 +703,10 @@ identifier(struct decl *dcl) flags |= (sclass == REGISTER) ? ISREGISTER : ISAUTO; break; case NOSCLASS: - flags |= (curctx == GLOBALCTX) ? ISGLOBAL : ISAUTO; + if (tp->op == FTN) + flags |= ISEXTERN; + else + flags |= (curctx == GLOBALCTX) ? ISGLOBAL : ISAUTO; break; case EXTERN: flags |= ISEXTERN;