tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Variable declaration as first statement in a 'case' block


From: brad
Subject: [Tinycc-devel] Variable declaration as first statement in a 'case' block gives error.
Date: Sun, 14 Jan 2024 23:34:09 +0000

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).

Brad



reply via email to

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