tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Variable declaration as first statement in a 'case' b


From: Herman ten Brugge
Subject: Re: [Tinycc-devel] Variable declaration as first statement in a 'case' block gives error.
Date: Tue, 16 Jan 2024 08:02:59 +0100
User-agent: Mozilla Thunderbird

On 1/15/24 00:34, brad@toptensoftware.com wrote:

Hey All,

First post here.  Firstly, thank you all for your work on this project.  I discovered tcc just a month or so ago and really enjoying using it as a back-end code generator for a custom scripting language I'm working on.

Anyway, I noticed this small bug:

A variable declaration as the first statement in a switch case block fails when it shouldn't:

        case 1:
            int z = 123;        // This fails with "identifier expected"
            break;

There's a pretty easy workaround, just insert an empty statement before.

        case 1:
            ;                   // This fixes it
            int z = 123;
            break;

(this was build of the mob repo on github - not sure if that affects things).

Just fixed on mob.

    Herman




reply via email to

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