3 ms·
That, and please 'fix struct packing'. For a moment I considered, 'oh just pass a struct around as the logical tuple of this data instead' and then I remembere
by mjevans 3y ago
That, and please 'fix struct packing'. For a moment I considered, 'oh just pass a struct around as the logical tuple of this data instead' and then I remembered they don't have to conform to any particular signature.
extern void foo(size_t dim, char a[dim]);
struct vecStr {size_t dim; char a[dim];};
// Not guaranteed ABI compatibility with above
extern void foo(struct vecStr);
It would be really nice if, formally, structs mostly happened to work as expected (if ordered reasonably, behave as packed/smallest) and if there were language, not just some compiler, supported prefix attributes that enforced either packed (smallest), fastest, or if some other methods are needed later those. Possibly manually specifying a target alignment.
Also at this point far too much code depends on signed integers as the default, but it would be nice if for added clarity stdint.h and similar had complimentary sintX_t equivalents to uintX_t even though sint8_t would just be a syntax alias for int8_t (preferably the reverse).