Obscure local-label related bug

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Obscure local-label related bug

Petr Skočík
I ran into this in some in some macro generated code:

int main()
{
    #if 1 //a workaround
    __label__ LBL;
    #endif

    //jump to a classical label out of an expr-stmt that had previously
overshadowed that classical label
    ({
         { __label__ LBL; LBL:; }
     goto LBL; });
    LBL:;
    //^won't compile on tcc but will on gcc and clang
}

Just making a note. I don't expect anybody to fix it anytime soon. :)

_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Obscure local-label related bug

Michael Matz-4
Hello,

On Tue, 14 Apr 2020, Petr Skocik wrote:

> I ran into this in some in some macro generated code:
>
> int main()
> {
>     #if 1 //a workaround
>     __label__ LBL;
>     #endif
>
>     //jump to a classical label out of an expr-stmt that had previously
> overshadowed that classical label
>     ({
>          { __label__ LBL; LBL:; }
>      goto LBL; });
>     LBL:;
>     //^won't compile on tcc but will on gcc and clang
> }
What t.... Uahhh!

> Just making a note. I don't expect anybody to fix it anytime soon. :)

Fixed in mob :)  (Nice find!)


Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel