<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"><<a href="mailto:freeswitch-dev.opencode@spamgourmet.com" target="_blank">freeswitch-dev.opencode@spamgourmet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'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'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'm using makepkg, the build tool for Arch Linux. (It'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's makepkg tool, I'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], &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, &r, sizeof(r));<br>
^<br>
cc1: all warnings being treated as errors<br>
Makefile:1988: recipe for target 'freeswitch-switch.o' failed<br>
make[2]: *** [freeswitch-switch.o] Error 1<br>
make[2]: Leaving directory '~/builds/freeswitch/src/freeswitch-1.6.6'<br>
Makefile:2420: recipe for target 'all-recursive' failed<br>
make[1]: *** [all-recursive] Error 1<br>
make[1]: Leaving directory '~/builds/freeswitch/src/freeswitch-1.6.6'<br>
Makefile:970: recipe for target 'all' failed<br>
make: *** [all] Error 2<br>
<br>
In parallel, I'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'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 "${enable_debug}" = "yes"; then<br>
AC_DEFINE([DEBUG],[],[Enable extra debugging.])<br>
saved_CFLAGS="$CFLAGS"<br>
CFLAGS=<br>
AX_CFLAGS_WARN_ALL_ANSI<br>
SWITCH_ANSI_CFLAGS=$CFLAGS<br>
CFLAGS="$saved_CFLAGS"<br>
<br>
if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then<br>
if test "$ac_cv_gcc_supports_w_no_unused_result" = 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="-g -ggdb"<br>
fi<br>
<br>
fi<br>
<br>
Though I'm a newbie so I may be missing something obvious. (For one, I don't yet understand the difference between SWITCH_AM_CFLAGS and other related variable(s).)<br>
<br>
I'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 "$ac_cv_gcc_supports_w_no_unused_result" = yes; then<br>
APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)<br>
+ APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)<br>
fi<br>
if test "${enable_64}" = "yes"; then<br>
case "$host" in<br>
@@ -533,9 +534,6 @@<br>
CFLAGS="$saved_CFLAGS"<br>
<br>
if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then<br>
- if test "$ac_cv_gcc_supports_w_no_unused_result" = 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="-g -ggdb"<br>
fi<br>
<br>
<br>
Can you tell whether I'm on the right track here (is this a bug in freeswitch'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't the best way to format code snippets for this mailing list; please let me know if there'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>