avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] fdevopen() uses calloc?


From: J.C. Wren
Subject: [avr-gcc-list] fdevopen() uses calloc?
Date: Wed, 21 Jan 2004 02:03:47 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20040110 Thunderbird/0.4

fdevopen() is using calloc(), which pulls in a lot of extra code. Is there any reason this couldn't use a static, instead? I wrote my own fdevopen function (slightly different name), but the linker is still pulling in fdevopen(), even though I can find no references to it. Why would this be? If I name my function fdevopen(), the linker gets all whiney about the size changing between my .o file and the libc file. To write mine, I had to cheat and copy over stdio_private.h, which is a major hack. What I'd like is an fdevopen() variant that allows passing a user provided block of memory. Unfortunately, this has to be of size FILE, which is opaque, so we don't know how large a block of memory to declare. In lieu of fdevopen() using a static buffer, can fdevopen() be a weak reference so at least overriding it doesn't cause the compiler to get upset?

   --jc


reply via email to

[Prev in Thread] Current Thread [Next in Thread]