Hello Rugxulo,
I wasn't linking it correctly. (Have to be careful about external
symbols, link order, etc.) And even when I thought I got it working,
it ended up crashing. Luckily I had my own replacement (simply for
printf("%ld") only). So my old replacement itself saved me like 25 kb
(down to only 20 kb)! Yeah, even a "Hello, world!" was like 32 kb. I'm
definitely not complaining, but a full C99 or whatever printf() is a
bit overkill for simple programs. Oh, and at least with some other
Hmm --- I seem to be also getting bogus floating point output
(non-numeric "digits" such as "(" and "/") when I compile TinyStdio's
own test program.
As I mentioned, the toolchain's Newlib runtime also has some provisions
for reducing the bloat needed for stdio. I suspect that, at least for
now, they are a bit ahead of TinyStdio/tinyprintf. For one thing,
Newlib's "nano formatted I/O" routines are more fine-grained and allow
you to link in only those routines you really need (TinyStdio in
contrast is one big module that includes ...scanf(...) and floating
point support, which is kind of inconvenient). Plus, they play well
with Newlib's own internal stdio structures, since they _are_ part of
Newlib itself.
I do not doubt though that tinyprintf and TinyStdio worked well for
their original problem domains.
Anyway, here are two things you can already try with my 10 March
gcc-ia16 toolchain:
(1) Specify the `-lnstdio' library to switch to the "nano formatted I/O"
stdio routines, which only handle C89 functionality and by default
exclude floating-point support. This should currently save about 12K of
space. (I am in the process of adding a more official-looking `-m...'
switch to GCC for this option.)
(2) Alternatively, use the (non-standard) routines iprintf(...),
fiprintf(...), etc. instead of printf(...), fprintf(...), etc. These
are versions of the "ordinary" formatted I/O routines that support C99
functionality, but without the floating-point stuff. This saves a bit
less space --- about 11K.
Thank you!
--
https://github.com/tkchia
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel