[llvm] r180099 - Un-revert the environ copy in ProgramTest after fixing it on OS X

Charles Davis cdavis5x at gmail.com
Tue Apr 23 14:06:50 PDT 2013


On Apr 23, 2013, at 3:06 PM, Reid Kleckner wrote:

> On Tue, Apr 23, 2013 at 4:43 PM, Charles Davis <cdavis5x at gmail.com> wrote:
>> 
>> On Apr 23, 2013, at 7:15 AM, Reid Kleckner wrote:
>>> Modified: llvm/trunk/unittests/Support/ProgramTest.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ProgramTest.cpp?rev=180099&r1=180098&r2=180099&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/unittests/Support/ProgramTest.cpp (original)
>>> +++ llvm/trunk/unittests/Support/ProgramTest.cpp Tue Apr 23 08:15:51 2013
>>> @@ -24,6 +30,21 @@ ProgramTestStringArg1("program-test-stri
>>> static cl::opt<std::string>
>>> ProgramTestStringArg2("program-test-string-arg2");
>>> 
>>> +static void CopyEnvironment(std::vector<const char *> &out) {
>>> +#ifdef __APPLE__
>>> +  // _NSGetEnviron() only works from the main exe on Mac.  Fortunately the test
>>> +  // should be in the executable.
>> No, no, no, I said that the *environ global* only works from the main exe. _NSGetEnviron() was specifically designed to be safe to call from a dylib. Sorry if I wasn't clear about that earlier.
> 
> In other words, all I have to do is forward declare environ and it
> would've worked?
Yeah.

Chip






More information about the llvm-commits mailing list