|
From: | Michael Matz |
Subject: | Re: [Tinycc-devel] struct bug: identical named struct members |
Date: | Sun, 29 Nov 2020 23:45:47 +0100 (CET) |
User-agent: | Alpine 2.21 (LSU 202 2017-01-01) |
Hello, On Sun, 29 Nov 2020, Tyge Løvset wrote:
> Mostly because of the T in tiny c compiler and because no profiling > shows field lookup to be a problem :) I have to disagree with this assessment. I only found this bug after debugging myself.
Sure, I agree the missing check for duplicates is a bug. My reaction was to the question of why there's no hashed mini-symbol table for struct members, not why the check is missing.
When structs have more than e.g. 10 fields, it is easy to add a name that already existed... But my main question is why are enums fields then checked, and what is the principal difference of checking enum fields and struct fields (other than struct creates a new scope during parsing)?
There's really no good reason, except that noone bothered to add the few lines to check for duplicates. I.e.: do it (the check, not the hash table) :)
Ciao, Michael.
Cheers. Tyge. On Sun, 29 Nov 2020 at 00:16, Michael Matz <matz.tcc@frakked.de> wrote: Hello again, On Sun, 29 Nov 2020, Michael Matz wrote: >> The only other fast C map I know >> of is khash (https://attractivechaos.github.io/klib), however not memory >> efficient, and the codebase is somewhat bigger. > > I guess there as many map implementations as there are C developers :-) Though I should say that yours from C99Containers look nice to use, despite the macros-as-template hell in the implementation :-) Ciao, Michael._______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
[Prev in Thread] | Current Thread | [Next in Thread] |