14 ms·
Adding opaque builtin struct types to C would be kind of a big deal though and would probably creep into other parts of the language and interact with them in u
by flohofwoe 5y ago
Adding opaque builtin struct types to C would be kind of a big deal though and would probably creep into other parts of the language and interact with them in unexpected ways. Features like fat pointers, slices, builtin dynamic arrays/strings or tagged unions would all require builtin opaque structs. This would be a whole different language (closer to Zig).
- mhh__ 5y agoIt really wouldn't be that hard to do. The syntax would be trivial, and the whole point is that you want it to creep so people actually use them. There's no overhead to doing it, but you save a bunch of bugs earlier, all for stopping conflating arrays with pointers, which is something not much code does these days anyway