clearenv for newlib
Joel Sherrill
joel.sherrill@oarcorp.com
Mon Sep 17 22:20:00 GMT 2007
Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Ralf Corsepius on 9/14/2007 11:33 PM:
>
>> On Fri, 2007-09-14 at 10:41 -0500, Joel Sherrill wrote:
>>
>>> Hi,
>>>
>>> I am porting a library to RTEMS that is calling clearenv().
>>> I am willing to implement one for newlib.
>>>
>> Frankly speaking, I am opposed to letting clearenv() into newlib,
>> because it is a non-standardized, non-documented function.
>>
>
> It is well documented, just not standardized yet; and it can be a whole
> lot more efficient than repeated unsetenv() calls, not to mention that
> without clearenv() you must walk environ, which POSIX discourages. And I
> am not opposed to adding it at ELIX level 4. If you use static linking,
> there is nothing wrong with additional functions in newlib, as long as
> they are in their own .o file, because they do not bloat your executable
> if you do not use them. And in larger systems with shared libraries, such
> as cygwin, the extra functions make newlib more useful, and can still be
> filtered by using smaller ELIX levels. For example, witness the recent
> addition of funopen and fopencookie to newlib - neither function is
> standardized (funopen comes from BSD and fopencookie from Linux), but
> having them at ELIX level 4 makes it easier to port autogen to Cygwin.
>
I don't have a problem with adding BSD compatible methods
that are written in modern C. I thought most of the problems
we encountered with BSD routines in RTEMS were header
file and type conflicts.
I do have a problem adding it when there are questions
about how to implement it. And since I can't figure out
how to reliably free the memory without adding tracking
code, that makes me not want to add it.
--joel
> - --
> Don't work too hard, make some time for fun as well!
>
> Eric Blake ebb9@byu.net
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (Cygwin)
> Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFG68dv84KuGfSFAYARAkbiAJ0cRbtC97KrHzRsWx5FxsRVWcCMaACgpq58
> Vh6jxiqF213l2h6O7yAi45s=
> =F7dN
> -----END PGP SIGNATURE-----
>
More information about the Newlib
mailing list