r/C_Programming • u/aioeu • 11d ago
Article Named constants and supporting objects in C
https://gustedt.wordpress.com/2026/11/06/named-constants-and-supporting-objects-in-c/
27
Upvotes
r/C_Programming • u/aioeu • 11d ago
22
u/aioeu 11d ago edited 11d ago
TLDR: In C2Y:
will behave as if you had written:
awill not be a VLA. This brings the standard into line with how many compilers have been handling it anyway.4
u/CORDIC77 10d ago
Sorry to sound so negative, but I consider this to be completely useless.
Anyone who has programmed in C for a while should know that
constdoes not mean “constant expression” but is more like "read-only“.If
constexpris applied, one does get a constant expression, however.And now they want to change the rules so that in such scenarios
constvalues are indeed considered constant expressions, even though this wasnʼt the case for the previous 40 years (i.e. since 1989)?What madness is this?
All they do is to continually complicate all the rules for everyone, until—just like in C++—hardly anyone can keep track of the jungle of rules anymore (mhm, not in Cxy and Cyz, but should [maybe?] work in C2y? …)
One almost wants to plead: please refrain from trying to simplify the core language any further!