This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: PATCH: 3.3: missing '=' in calls to putenv


> > -  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]