]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
-std=qcc now errors on C-style function syntax
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 10 Nov 2012 11:02:15 +0000 (12:02 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 09:13:00 +0000 (10:13 +0100)
parser.c

index 53e1ffbf271eda0e75bb5eeddbb5504ecb148c2d..c02bd41248030c7d243352a323aec1f84155a58f 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2333,6 +2333,8 @@ static ast_value *parse_typename(parser_t *parser, ast_value **storebase)
     }
 
     /* now there may be function parens again */
+    if (parser->tok == '(' && opts_standard == COMPILER_QCC)
+        parseerror(parser, "C-style function syntax is not allowed in -std=qcc");
     while (parser->tok == '(') {
         var = parse_parameter_list(parser, var);
         if (!var) {
@@ -2388,6 +2390,8 @@ static bool parse_variable(parser_t *parser, ast_block *localblock)
 
         /* Part 0: finish the type */
         while (parser->tok == '(') {
+            if (opts_standard == COMPILER_QCC)
+                parseerror(parser, "C-style function syntax is not allowed in -std=qcc");
             var = parse_parameter_list(parser, var);
             if (!var) {
                 retval = false;