aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-02-28 12:36:21 +0000
committergingerBill <bill@gingerbill.org>2022-02-28 12:36:21 +0000
commitab9d1f99fdb776352352d882f49aefc80d0e9d58 (patch)
tree5b9d2a94a415ca408147f6efa1179e8b34ae9887 /src/check_type.cpp
parent45124e4d5c19d477c2fc80282e153cc0bb7ac6ff (diff)
Change `#c_vararg` checking to only disallow odin calling conventions
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 64fb67723..c2324ee5a 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -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;
}
}
}