aboutsummaryrefslogtreecommitdiff
path: root/parser.y
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2022-11-14 00:40:07 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-11-15 02:45:08 +0100
commitf51fc836c5b690f5448e76196dd40bdb55957a11 (patch)
treeee536320125658080ae96b1085278f83e042e7e2 /parser.y
parent3902cb2fcae6e2028252b5d2016bf0e99ed74980 (diff)
downloadmig-f51fc836c5b690f5448e76196dd40bdb55957a11.tar.gz
mig-f51fc836c5b690f5448e76196dd40bdb55957a11.tar.bz2
mig-f51fc836c5b690f5448e76196dd40bdb55957a11.zip
Initialize basic types once and print errors for duplicate definitions
For kernel server or user subsystems we would initialize basic types twice, once in main() and again for the subsystem declaration. Instead, initialize basic types when the subsystem is declared and then throw errors when types are defined multiple times. Message-Id: <Y3HUt/YAKaqMMTi3@viriathus>
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y5
1 files changed, 2 insertions, 3 deletions
diff --git a/parser.y b/parser.y
index 104f604..23294bf 100644
--- a/parser.y
+++ b/parser.y
@@ -212,6 +212,7 @@ Subsystem : SubsystemStart SubsystemMods
IsKernelUser ? ", KernelUser" : "",
IsKernelServer ? ", KernelServer" : "");
}
+ init_type();
}
;
@@ -238,7 +239,6 @@ SubsystemMod : syKernelUser
IsKernelUser = TRUE;
port_size = vm_offset_size;
port_size_in_bits = vm_offset_size_in_bits;
- init_type();
}
| syKernelServer
{
@@ -247,7 +247,6 @@ SubsystemMod : syKernelUser
IsKernelServer = TRUE;
port_size = vm_offset_size;
port_size_in_bits = vm_offset_size_in_bits;
- init_type();
}
;
@@ -351,7 +350,7 @@ TypeDecl : syType NamedTypeSpec
identifier_t name = $2->itName;
if (itLookUp(name) != itNULL)
- warn("overriding previous definition of %s", name);
+ error("overriding previous definition of %s", name);
itInsert(name, $2);
}
;