[cfe-dev] Intercepting environment variables set by xcodebuild and passing them to static analyzer

Jean-Daniel Dupas devlists at shadowlab.org
Wed Nov 5 23:46:11 PST 2008


Le 6 nov. 08 à 07:22, Nikita Zhuk a écrit :

>
> On 6.11.2008, at 3.04, Ted Kremenek wrote:
>
>> All environment variables that xcodebuild sets should be observable  
>> by the clang process.  Using getenv() within your analysis code  
>> should be a portable solution for accessing those values.  Does  
>> that not work?
>
> It doesn't seem to work, or I'm doing something wrong :). For  
> example, the following line, when inserted into static analyzer,  
> prints "TARGET_NAME env variable is set: 0":
> fprintf(stderr, "TARGET_NAME env variable is set: %d\n",  
> getenv("TARGET_NAME") != NULL);
>
> Although xcodebuild does set the TARGET_NAME when compiling (I dump  
> all env variables from xcodebuild with a Run Script Phase). The only  
> env variables related to compiling I see from the clang process are  
> CCC_ANALYZER_ANALYSIS, LDPLUSPLUS, CCC_ANALYZER_HTML, CLANG and CC.
>

AFAK xcodebuild does not set any variable, except when it execute a  
runscript phase, and I guess it just pass these variable as parameter  
to exec when it execute the script subprocess and does not set them  
globaly.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20081106/1f81eb02/attachment.html>


More information about the cfe-dev mailing list