Hi Eric,<br><br><br>1) Your first option wouldn&#39;t work because &quot;CMAKE_REQUIRED_FLAGS&quot; isn&#39;t known by neither try_compile, neither the macro.<br><br>2) Wouldn&#39;t work either because try_compile doesn&#39;t take command line parameters (at least not in this form &amp; unless you will construct the makefile from hand inside this script).<br>

<br>3) I think this is the only feasible way in fact... Although I find this the least nicest way, and as such I didn&#39;t try that one.<br><br><br>Grtz,<br>Steven<br><br><div class="gmail_quote">2009/7/8 Eric Noulard <span dir="ltr">&lt;<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/7/8 Steven Van Ingelgem &lt;<a href="mailto:steven@vaningelgem.be">steven@vaningelgem.be</a>&gt;:<br>


<div><div></div><div class="h5">&gt; Hi,<br>
&gt;<br>
&gt;<br>
&gt; I tried this call:<br>
&gt; CHECK_FUNCTION_EXISTS(snprintf  HAS_snprintf)<br>
&gt;<br>
&gt;<br>
&gt; Which results in this error being generated:<br>
&gt; C:\MinGW\bin\gcc.exe   -g -ggdb -O0 -Wall -Werror<br>
&gt; -DCHECK_FUNCTION_EXISTS=snprintf   -o<br>
&gt; CMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj   -c &quot;C:\Program<br>
&gt; Files\CMake 2.7\share\cmake-2.7\Modules\CheckFunctionExists.c&quot;<br>
&gt; cc1.exe: warnings being treated as errors<br>
&gt; C:\Program Files\CMake 2.7\share\cmake-2.7\Modules\CheckFunctionExists.c:3:<br>
&gt; error: conflicting types for built-in function &#39;snprintf&#39;<br>
&gt;<br>
&gt;<br>
&gt; What I understand is that the snprintf type exists, but conflicts with the<br>
&gt; built-in version... So this should return &#39;true&#39; in fact...<br>
&gt;<br>
&gt; What can I do about it?<br>
<br>
</div></div>Disable builtin support with<br>
SET(CMAKE_REQUIRED_FLAGS &quot;-fno-builtin&quot;)<br>
see: <a href="http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/C-Dialect-Options.html#C-Dialect-Options" target="_blank">http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/C-Dialect-Options.html#C-Dialect-Options</a><br>
<br>
or<br>
<br>
update CheckFunctionExists.cmake in order to make it try builtin first?<br>
<br>
or<br>
<br>
update CheckFunctionExists.cmake in order to make it catch the<br>
<div class="im">&quot;conflicting types for built-in function&quot;<br>
</div>and return true in this case?<br>
<font color="#888888"><br>
<br>
--<br>
Erk<br>
Membre de l&#39;April - « promouvoir et défendre le logiciel libre » -<br>
<a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
</font></blockquote></div><br>