<div dir="ltr">Open a JIRA in the platform category <a href="https://freeswitch.org/jira">https://freeswitch.org/jira</a><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 23, 2016 at 10:28 PM,  <span dir="ltr">&lt;<a href="mailto:freeswitch-dev.opencode@spamgourmet.com" target="_blank">freeswitch-dev.opencode@spamgourmet.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m getting a compilation error compiling the latest production release (1.6.6) when using --disable-debug with certain (as yet undermined) environment settings. The approximate steps I&#39;m following are:<br>
curl -O <a href="https://files.freeswitch.org/releases/freeswitch/freeswitch-1.6.6.tar.xz" rel="noreferrer" target="_blank">https://files.freeswitch.org/releases/freeswitch/freeswitch-1.6.6.tar.xz</a><br>
tar -xvf freeswitch-1.6.6.tar.xz<br>
cd freeswitch-1.6.6<br>
./configure --disable-debug<br>
make<br>
<br>
Except I&#39;m using makepkg, the build tool for Arch Linux. (It&#39;s ultimately for Arch Linux ARM on a Raspberry Pi Zero, but the same thing happens with normal x86_64 Arch Linux). When I use the exact steps above in a shell, make succeeds, but when I run the equivalent within ArchLinux&#39;s makepkg tool, I&#39;m getting the following error (lightly sanitized):<br>
  CC     freeswitch-switch.o<br>
src/switch.c: In function ‘main’:<br>
src/switch.c:1194:5: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]<br>
     (void)read(fds[1], &amp;v, sizeof(v));<br>
     ^<br>
src/switch.c: In function ‘check_fd’:<br>
src/switch.c:236:5: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]<br>
     (void)write(fd, &amp;r, sizeof(r));<br>
     ^<br>
cc1: all warnings being treated as errors<br>
Makefile:1988: recipe for target &#39;freeswitch-switch.o&#39; failed<br>
make[2]: *** [freeswitch-switch.o] Error 1<br>
make[2]: Leaving directory &#39;~/builds/freeswitch/src/freeswitch-1.6.6&#39;<br>
Makefile:2420: recipe for target &#39;all-recursive&#39; failed<br>
make[1]: *** [all-recursive] Error 1<br>
make[1]: Leaving directory &#39;~/builds/freeswitch/src/freeswitch-1.6.6&#39;<br>
Makefile:970: recipe for target &#39;all&#39; failed<br>
make: *** [all] Error 2<br>
<br>
In parallel, I&#39;m checking with the Arch Linux folks for help understanding the makepkg environment (perhaps some compilation *FLAGS environment variables?) that are likely needed to reproduce the error on other distributions. I&#39;ll reply further if I get better data from them.<br>
<br>
However, from a look at <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>, it does appear that unused result warnings/errors are being suppressed via SWITCH_AM_CFLAGS perhaps only in when debug is enabled:<br>
if test &quot;${enable_debug}&quot; = &quot;yes&quot;; then<br>
        AC_DEFINE([DEBUG],[],[Enable extra debugging.])<br>
        saved_CFLAGS=&quot;$CFLAGS&quot;<br>
        CFLAGS=<br>
        AX_CFLAGS_WARN_ALL_ANSI<br>
        SWITCH_ANSI_CFLAGS=$CFLAGS<br>
        CFLAGS=&quot;$saved_CFLAGS&quot;<br>
<br>
        if test &quot;x${ax_cv_c_compiler_vendor}&quot; = &quot;xgnu&quot; ; then<br>
            if test &quot;$ac_cv_gcc_supports_w_no_unused_result&quot; = yes; then<br>
              APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)<br>
            fi<br>
            APR_ADDTO(SWITCH_AM_CFLAGS, -g -ggdb)<br>
            export DEBUG_CFLAGS=&quot;-g -ggdb&quot;<br>
        fi<br>
<br>
fi<br>
<br>
Though I&#39;m a newbie so I may be missing something obvious. (For one, I don&#39;t yet understand the difference between SWITCH_AM_CFLAGS and other related variable(s).)<br>
<br>
I&#39;m currently working around the error using the following patch:<br>
--- configure.ac.old    2016-02-23 16:50:04.190884018 -0800<br>
+++ <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>        2016-02-23 16:50:29.103970709 -0800<br>
@@ -410,6 +410,7 @@<br>
     APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)<br>
     if test &quot;$ac_cv_gcc_supports_w_no_unused_result&quot; = yes; then<br>
       APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)<br>
+      APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)<br>
     fi<br>
     if test &quot;${enable_64}&quot; = &quot;yes&quot;; then<br>
        case &quot;$host&quot; in<br>
@@ -533,9 +534,6 @@<br>
        CFLAGS=&quot;$saved_CFLAGS&quot;<br>
<br>
        if test &quot;x${ax_cv_c_compiler_vendor}&quot; = &quot;xgnu&quot; ; then<br>
-           if test &quot;$ac_cv_gcc_supports_w_no_unused_result&quot; = yes; then<br>
-             APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)<br>
-           fi<br>
            APR_ADDTO(SWITCH_AM_CFLAGS, -g -ggdb)<br>
            export DEBUG_CFLAGS=&quot;-g -ggdb&quot;<br>
        fi<br>
<br>
<br>
Can you tell whether I&#39;m on the right track here (is this a bug in freeswitch&#39;s configure script)? If this is the right fix (or close to it), would you be interested in taking it?<br>
<br>
(And apologies if this isn&#39;t the best way to format code snippets for this mailing list; please let me know if there&#39;s a better way.)<br>
<br>
Thanks,<br>
<br>
David<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" rel="noreferrer" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Anthony Minessale II       ♬ @anthmfs  ♬ @FreeSWITCH  ♬<div><br><div>☞ <a href="http://freeswitch.org/" target="_blank">http://freeswitch.org/</a>  ☞ <a href="http://cluecon.com/" target="_blank">http://cluecon.com/</a>  ☞ <a href="http://twitter.com/FreeSWITCH" target="_blank">http://twitter.com/FreeSWITCH</a></div><div><div>☞ <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch ☞ <u><a href="http://freeswitch.org/g+" target="_blank">http://freeswitch.org/g+</a></u><br><br></div><div>ClueCon Weekly Development Call <br></div><div>☎ <a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a>  ☎ +19193869900 </div><div><br></div></div></div><div><a href="https://www.youtube.com/watch?v=9XXgW34t40s" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank">https://www.youtube.com/watch?v=9XXgW34t40s</a></div><div><a href="https://www.youtube.com/watch?v=NLaDpGQuZDA" target="_blank">https://www.youtube.com/watch?v=NLaDpGQuZDA</a><br></div></div></div></div></div></div></div>
</div>