<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 6 nov. 08 à 07:22, Nikita Zhuk a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 6.11.2008, at 3.04, Ted Kremenek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>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?<br></div></blockquote></div><br><div>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":</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(196, 26, 22); "><span style="color: #2e0d6e">fprintf</span><span style="color: #000000">(</span><span style="color: #643820">stderr</span><span style="color: #000000">, </span>"TARGET_NAME env variable is set: %d\n"<span style="color: #000000">, <span style="color: #2e0d6e">getenv</span>(<span style="color: #c41a16">"TARGET_NAME"</span>) != <span style="color: #aa0d91">NULL</span>);</span></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div>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.</div><div><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></div></div></blockquote><br></div><div>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.</div><div><br></div><div><br></div></body></html>