tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] struct bug: identical named struct members


From: Michael Matz
Subject: Re: [Tinycc-devel] struct bug: identical named struct members
Date: Sat, 28 Nov 2020 00:31:30 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hello,

On Fri, 27 Nov 2020, Tyge Løvset wrote:

Is this a known bug, or regression? 

Known bug.

I tried to follow the code in parse_btype() in tccgen.c for the missing
struct member symbol lookup check, but didn't succeed so far:

      } else {
            c = 0;
            flexible = 0;
            while (tok != '}') {
                if (!parse_btype(&btype, &ad1)) {
    skip(';');
    continue;
}

Member lookup is linear, so checking for duplicates is quadratic, so TCC doesn't bother to do it. The check would belong to struct_decl, not parse_btype, probably involving find_field before adding it.


Ciao,
Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]