This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: PATCH: 3.3: missing '=' in calls to putenv
- From: "Kean Johnston" <jkj at sco dot com>
- To: "'Nathan Sidwell'" <nathan at codesourcery dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 12 Apr 2003 09:26:37 -0700
- Subject: RE: PATCH: 3.3: missing '=' in calls to putenv
- Organization: The SCO Group
> > - putenv (xstrdup ("COMPILER_PATH"));
> > - putenv (xstrdup ("LIBRARY_PATH"));
> > + putenv (xstrdup ("COMPILER_PATH="));
> > + putenv (xstrdup ("LIBRARY_PATH="));
>
> What systems make the xstrdup necessary? I thought putenv
> ("name=") was valid, it being a string constant.
None that *I* know of, but I'd bet there are some systems out there
that prototpe putenv as taking a char *, for which there havent been
all the required fixincludes work done etc etc. I don't know who did
this code originally, but I was fixing the one error I encountered
not looking for others :)
Although most systems should be fine without the xstrdup I can
certainly envision some that would need it, and considering the
small size involved it may be better to err on the side of caution.
Kean