Re: [cc65] some patches

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2010-03-16 19:01:13
On Tue, Mar 16, 2010 at 05:45:22PM +0100, Kajtár Zsolt wrote:
> > If you use printf, write() is called internally. printf calls fprintf which
> > calls vfprintf, which calls write. In this call chain, the address of write is
> > part of the precompiled library and a simple #define in the user code won't
> > change the contents of the library you're linking to your application.
>
> Blockread/write only makes sense with bulk data transfers, and printf is
> usually not used like that.

That is not the problem. Sorry for not being clear enough.

If you use printf, fprintf, fwrite, puts, putc or whatever, the necessary
modules are linked to the application. These modules are contained in the C64
library and were compiled with standard settings. Which means that they
reference an identifier named "write". Any #defines can only change
identifiers in the code where they're active. So if you compile your
application with __USE_IDE64, which causes "write" to be replaced by
"write_ide64", this will only take effect for the compiled code, but not for
the modules in the library.

So any code that uses __USE_IDE64 and one of the functions above (or any other
functions that calls one of these), will have not only the larger ide64
version of write() linked in, but also the standard C64 version. Which is the
ultimate bloat.

The only real solution for that problem is to replace the module that contains
write by one that exports the same identifier and functionality. Which in fact
means another, ide64 specific library.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Mar 16 19:01:26 2010

This archive was generated by hypermail 2.1.8 : 2010-03-16 19:01:29 CET