Hello, On Sat, 20 Mar 2021, Dmitry Selyutin wrote:
This needs casts, both sign- and type-wise, e.g. signed long long to unsigned char, and has no way to enforce type safety, even in the minimal form. A minimally suitable form would require a statement expression, plus typeof, and even then it would have to be tuned to work with types that are binary compatible (at least casts are needed). I don't see that many benefits there. This is a deceptive simplicity which doesn't buy you much after all. Per-type functions, on the other hand, are known to be generated by other compilers, so you can be compatible with the code they produce, whilst keeping other pros, like type deduction and using zero non-portable extensions.
Within the implementation of compiler provided facilities itself we can make use of any non-portable extensions we like.
Type safety already goes out the window with type generic functions.Dispatching to per-type functions (instead of per-size ones) is mere busy work; all that code is generated and implementation specific, not user visible.
Ciao, Michael.
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
