Hi, On Fri, Jul 8, 2022 at 6:30 PM Ralf Quint <freedos...@gmail.com> wrote: > > With C(++), it's more like "let's throw everything in one big pot and > then lets see what we actually need in our program". A huge advantage of > Turbo/Borland Pascal, Delphi and FreePascal is that they are all capable > of "smart-linking". The compiler/linker is doing a lot of the work that > in the other languages is part of the responsibility of the programmer. > And more and more of them don't care, that's why we have to deal with so > much software bloat...
Everything after C89 got much bigger, e.g. printf(). That's why things like IA16-ELF have "-mnewlib-nano-stdio" flags. I modified a very simple program of mine to avoid printf() entirely, and it was noticeably smaller. You really shouldn't have to link everything in just to print out chars, strings, and integers. (Pascal's write() is much simpler and safer to use but less dynamic at runtime.) To be fair, GNU ld does support -ffunction-sections -fdata-sections -Wl,--gc-sections ... it even seems to (barely) work for DJGPP (COFF)! UPX helps a ton, too. But nothing's perfect. _______________________________________________ Freedos-user mailing list Freedos-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-user