aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index 7144ccd..8464e64 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -5423,6 +5423,10 @@ ST_FUNC void decl(int l)
while (1) { /* iterate thru each declaration */
type = btype;
type_decl(&type, &ad, &v, TYPE_DIRECT);
+ if (((type.t & (VT_STATIC|VT_FUNC)) == (VT_STATIC|VT_FUNC))
+ && (l == VT_LOCAL)) {
+ error("Function without file scope cannot be static");
+ }
#if 0
{
char buf[500];