From b452bdc5e46ce6626293ba8ac1f8a4a9f37f73b6 Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 13 Mar 2015 12:18:43 -0400 Subject: [PATCH] Catch fastcall pointers to variadic functions. --- src/cc65/declare.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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"); -- 2.39.5