tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Commit 8569048 introduces bug with local extern


From: Giovanni Mascellani
Subject: [Tinycc-devel] Commit 8569048 introduces bug with local extern
Date: Tue, 16 Jul 2019 14:01:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

Hi,

commit 85690480313c4a8b0efeb3761ee68456cfe57840 introduces a bug when
trying to compile the following file:

int main() {
        extern char *x;
}
void main1() {
        extern char *x;
}

Fails with:
t2.c:5: error: incompatible types for redefinition of 'x'

Doing some random tests, it seems that the error appears when x is
defined as a pointer, but not when x is defined as a standard numeric
type (int, char, ...). Also, the error does not appear when function
main1() is deleted. I believe that when compiling a local extern
variable some global state is changed and it is not reset at the end of
the function.

I'm not able to understand anything better from the code.

Thanks, Giovanni.
-- 
Giovanni Mascellani <address@hidden>
Postdoc researcher - Université Libre de Bruxelles

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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