diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-21 17:49:05 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-21 17:49:05 +0100 |
| commit | 264ca00db72f56e2af8242a90e35a49b6ae13f86 (patch) | |
| tree | c7a1f170fea7c22b4d3734282716b0ee0e74ad7c /src/check_decl.cpp | |
| parent | 6b65ef6d8847ea7dcb23a556e12daae69738c5c2 (diff) | |
| parent | 5957d7f7bee7e5fac4035d47ecaaaad022adbfb8 (diff) | |
Merge branch 'master' of https://github.com/gingerBill/Odin
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index dede1a26c..672673faf 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -333,6 +333,11 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) { error(e->token, "Procedure type of `main` was expected to be `proc()`, got %s", str); gb_string_free(str); } + if (proc_type->Proc.calling_convention != ProcCC_Odin && + proc_type->Proc.calling_convention != ProcCC_Contextless) { + error(e->token, "Procedure `main` cannot have a custom calling convention"); + } + proc_type->Proc.calling_convention = ProcCC_Contextless; } if (is_inline && is_no_inline) { |