On 11.08.2025 05:20, uso ewin wrote:
My first code had a bug with an array declared in if.
It should be fixed, here:
https://github.com/cosmo-ray/tcc/commits/c2y-if-switch-decl/

The patch is pretty unlikely to bring a new bug to existing code,
as, new code should be called only if we're in a declaration inside an if
or a switch.

I've also added more tests.
Anyway, I'd like to know if there is something wrong with the patch,
or if someone is against having this in Tinycc.

If no one answer this, I'll push to mob in 1 week. (so the 17/08)

Forget that 'keep_on_stack' idea. That will never work correctly.
Instead let decl() return the token 'v' and push that on stack.

See: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3580.htm
if (T x = y) { ...
// is ALWAYS the same as
if (T x = y; x) { ...

Also please, no extra variables or parameters, no clauses at the
top of functions, no error messages, no copy & paste code, no tests.

But check against gcc.  We don't want people say "works in gcc, tcc
gives me error" ;)

-- gr


Matthias

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to