From da927b5d411f6503f969e7d2f46174fdf907c577 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 24 Dec 2012 11:38:33 +0100 Subject: [PATCH] print an error when static is used in global scope - this is currently not being handled as expected --- parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parser.c b/parser.c index c8c6fb3..4058a8f 100644 --- a/parser.c +++ b/parser.c @@ -4015,6 +4015,9 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield ast_member *me[3]; + if (!localblock && is_static) + parseerror(parser, "`static` qualifier is not supported in global scope"); + /* get the first complete variable */ var = parse_typename(parser, &basetype, cached_typedef); if (!var) { -- 2.39.2