Change #c_vararg checking to only disallow odin calling conventions

This commit is contained in:
gingerBill
2022-02-28 12:36:21 +00:00
parent 45124e4d5c
commit ab9d1f99fd

View File

@@ -2031,10 +2031,14 @@ bool check_procedure_type(CheckerContext *ctx, Type *type, Ast *proc_type_node,
if (param_count > 0) {
Entity *end = params->Tuple.variables[param_count-1];
if (end->flags&EntityFlag_CVarArg) {
if (cc == ProcCC_StdCall || cc == ProcCC_CDecl) {
switch (cc) {
default:
type->Proc.c_vararg = true;
} else {
break;
case ProcCC_Odin:
case ProcCC_Contextless:
error(end->token, "Calling convention does not support #c_vararg");
break;
}
}
}