News for hackers. Stuff that matters.
Re:Show HN: Xcc700: Self-hosting mini C compiler for ESP32 (... by fuhsnn on Friday December 26, 2025 @04:33PM (#46396516)
I would love to see how you handle variably-modified types, the way I retrofitted them onto chibicc never felt quite right, and I've never seen another non-gcc/clang compiler fully support noplate's VM type patterns.
Re:Show HN: Xcc700: Self-hosting mini C compiler for ESP32 (... by uecker on Saturday December 27, 2025 @07:16AM (#46401314)
Maybe I fill find the time to clean it up and make it public. But did not find VM-types difficult to implement, the type just depends on some run-time value, so at the point in time where the size expression is evaluated, one stores the result in a hidden variable which the type refers to.
Re:Show HN: Xcc700: Self-hosting mini C compiler for ESP32 (... by fuhsnn on Saturday December 27, 2025 @10:11AM (#46402389)
Looking forward to the release!

What I found troublesome were not really the caching of array count, but when and where should the side effect be represented in AST, for example this one: https://godbolt.org/z/rcT1d8WWe the puts() call is a side effect for automatic variable but completely ignored for static variable.

Re:Show HN: Xcc700: Self-hosting mini C compiler for ESP32 (... by uecker on Saturday December 27, 2025 @10:41AM (#46402604)
Yes, it is a bit of mess. We started to make this more precise in the C standard when those expression have to be evaluated, but there are still issues. And when this is involved extensions there are more issues. I think in this example, such initializer would not be allowed in ISO C. I also fixed many bugs in GCC .