From: johanknol Date: Thu, 6 Sep 2001 16:17:38 +0000 (+0000) Subject: Bernhard mentioned that "()" equals "(void)" X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=475ad034dc0764b5ebc1eeb6d6c2148af6787939;p=fw%2Fsdcc Bernhard mentioned that "()" equals "(void)" git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1232 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCC.y b/src/SDCC.y index e9f509d3..77eb3c43 100644 --- a/src/SDCC.y +++ b/src/SDCC.y @@ -1102,7 +1102,7 @@ abstract_declarator2 | abstract_declarator2 '(' ')' { if (getenv("DONT_IGNORE_FUNCTION_SPECIFIERS")) { // this was previously ignored (cvs < 1.37) - // but $1 must be a pointer that points to a function + // $1 must be a pointer to a function sym_link *p=newLink(); DCL_TYPE(p) = FUNCTION; $1->next=p; @@ -1111,8 +1111,15 @@ abstract_declarator2 | abstract_declarator2 '(' parameter_type_list ')' { if (getenv("DONT_IGNORE_FUNCTION_SPECIFIERS")) { // this was previously ignored (cvs < 1.37) - // this is nonsense, so let's just burp something - werror(E_TOO_FEW_PARMS); + if (!IS_VOID($3->type)) { + // this is nonsense, so let's just burp something + werror(E_TOO_FEW_PARMS); + } else { + // $1 must be a pointer to a function + sym_link *p=newLink(); + DCL_TYPE(p) = FUNCTION; + $1->next=p; + } } }