diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2022-11-14 00:40:07 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-11-15 02:45:08 +0100 |
commit | f51fc836c5b690f5448e76196dd40bdb55957a11 (patch) | |
tree | ee536320125658080ae96b1085278f83e042e7e2 /parser.y | |
parent | 3902cb2fcae6e2028252b5d2016bf0e99ed74980 (diff) | |
download | mig-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.y | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); } ; |