Reserve the link_name main

This commit is contained in:
Ginger Bill
2017-09-30 11:28:17 +01:00
parent e2b9c87aa8
commit 5259de5872

View File

@@ -525,6 +525,8 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) {
"\tat %.*s(%td:%td)",
LIT(name), LIT(pos.file), pos.line, pos.column);
}
} else if (name == "main") {
error(d->proc_lit, "The link name `main` is reserved for internal use");
} else {
map_set(fp, key, e);
}
@@ -549,6 +551,8 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) {
"Non unique linking name for procedure `%.*s`\n"
"\tother at %.*s(%td:%td)",
LIT(name), LIT(pos.file), pos.line, pos.column);
} else if (name == "main") {
error(d->proc_lit, "The link name `main` is reserved for internal use");
} else {
map_set(fp, key, e);
}