From: Greg King Date: Fri, 13 Mar 2015 16:18:43 +0000 (-0400) Subject: Catch fastcall pointers to variadic functions. X-Git-Tag: V2.15~3^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b452bdc5e46ce6626293ba8ac1f8a4a9f37f73b6;p=cc65 Catch fastcall pointers to variadic functions. --- diff --git a/src/cc65/declare.c b/src/cc65/declare.c index e6417c6a8..4fab3ea0a 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -353,8 +353,12 @@ static void FixQualifiers (Type* DataType) Error ("Mismatch between pointer's and function's calling conventions"); } } else { - /* Move the qualifier from the pointer to the function. */ - T[1].C |= Q; + if (Q == T_QUAL_FASTCALL && IsVariadicFunc (T + 1)) { + Error ("Variadic-function pointers cannot be `__fastcall__'"); + } else { + /* Move the qualifier from the pointer to the function. */ + T[1].C |= Q; + } } } else { Error ("Not pointer to a function; can't use a calling convention");