tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Typesystem patches


From: Petr Skočík
Subject: Re: [Tinycc-devel] Typesystem patches
Date: Wed, 28 Nov 2018 13:05:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

On 11/28/18 12:55 PM, Petr Skočík wrote:
> On 11/28/18 11:29 AM, Petr Skočík wrote:
>> Hi,
>>
>> I think I should mention I've pushed a couple (triple?) of typesystem
>> patches.
>>
>> The first 2 were trivial (1. allow ({ }) inside of _Generic's
>> controlling expr without jeopardizing that _Generic's
>> integer-constant-ness, 2. make casts drop top-level qualifiers) and I
>> didn't even bother to drop a line here on the mailing list. The last
>> fixes pointer type handling inside of `?:`.
>>
>> I think they all should be OK (tests are all passing including the new
>> ones I added, which didn't pass with old tcc), but reviews welcome anyway.
>>
>>
>> Best regards,
>> Petr Skocik
>>
>> _______________________________________________
>> Tinycc-devel mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>>
> Ok, so the last one's a regression (I'm so sorry! :()
> 
> void f()
> {
>       extern char **bx_argv;
>       _Generic(bx_argv, char**: (void)0);
>       _Generic(0?(char const*)0:bx_argv[0], char const*: (void)0);
>       _Generic(bx_argv, char**: (void)0); //<<< new bug here, bx_argv is now
> char const** but it shouldn' be
> }
> 
> I believe the combined qualifiers should go on a deep, not shallow copy
> of one the types but I'm not quite sure how to manage the lifetime of
> that. I'll try and figure it out or, at worst, commit a revert.
> 
> Cheers,
> Petr S.
> 
Ok, so the last one's a regression (I'm so sorry! :()

void f()
{
        extern char **bx_argv;
        _Generic(bx_argv, char**: (void)0);
        _Generic(0?(char const*)0:bx_argv[0], char const*: (void)0);
        _Generic(bx_argv, char**: (void)0); //<<< new bug here, bx_argv is now
char const** but it shouldn't be
}

I believe the combined qualifiers should go on a deep, not shallow copy
of one the types but I'm not quite sure how to manage the lifetime of
that. I'll try and figure it out or, at worst, commit a revert.

Cheers,
Petr S.



reply via email to

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