<HTML>
<HEAD>
<TITLE>Re: [Freeswitch-dev] error in mod_spandsp_modem.c</TITLE>
</HEAD>
<BODY>
<FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>What platform is this on? You need to be specific when reporting these types of errors....<BR>
<BR>
<BR>
On 5/8/12 4:49 PM, &quot;Ted Walther&quot; &lt;<a href="tederific@gmail.com">tederific@gmail.com</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:11pt'>Compiling mod_spandsp_modem.c ...<BR>
cc1: warnings being treated as errors<BR>
mod_spandsp_modem.c: In function 'modem_init':<BR>
mod_spandsp_modem.c:380: warning: ISO C90 forbids mixed declarations and code<BR>
mod_spandsp_modem.c:398: error: invalid storage class for function 'channel_on_init'<BR>
mod_spandsp_modem.c:399: error: invalid storage class for function 'channel_on_hangup'<BR>
mod_spandsp_modem.c:400: error: invalid storage class for function 'channel_on_destroy'<BR>
mod_spandsp_modem.c:401: error: invalid storage class for function 'channel_on_routing'<BR>
mod_spandsp_modem.c:402: error: invalid storage class for function 'channel_on_exchange_media'<BR>
mod_spandsp_modem.c:403: error: invalid storage class for function 'channel_on_soft_execute'<BR>
mod_spandsp_modem.c:407: error: invalid storage class for function 'channel_outgoing_channel'<BR>
mod_spandsp_modem.c:408: error: invalid storage class for function 'channel_read_frame'<BR>
mod_spandsp_modem.c:409: error: invalid storage class for function 'channel_write_frame'<BR>
mod_spandsp_modem.c:410: error: invalid storage class for function 'channel_kill_channel'<BR>
mod_spandsp_modem.c:419: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:419: error: invalid storage class for function 'channel_on_init'<BR>
mod_spandsp_modem.c: In function 'channel_on_init':<BR>
mod_spandsp_modem.c:445: warning: implicit declaration of function 'ioctl'<BR>
mod_spandsp_modem.c: In function 'modem_init':<BR>
mod_spandsp_modem.c:489: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:489: error: invalid storage class for function 'channel_on_routing'<BR>
mod_spandsp_modem.c:503: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:503: error: invalid storage class for function 'channel_on_execute'<BR>
mod_spandsp_modem.c:519: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:519: error: invalid storage class for function 'channel_on_destroy'<BR>
mod_spandsp_modem.c:543: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:543: error: invalid storage class for function 'channel_on_hangup'<BR>
mod_spandsp_modem.c:560: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:560: error: invalid storage class for function 'channel_kill_channel'<BR>
mod_spandsp_modem.c:586: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:586: error: invalid storage class for function 'channel_on_soft_execute'<BR>
mod_spandsp_modem.c:592: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:592: error: invalid storage class for function 'channel_on_exchange_media'<BR>
mod_spandsp_modem.c:608: warning: ISO C forbids nested functions<BR>
mod_spandsp_modem.c:608: error: invalid storage class for function 'channel_on_reset'<BR>
<BR>
It looks to me like the error is here:<BR>
<BR>
#if USE_OPENPTY<BR>
    if (openpty(&amp;modem-&gt;master, &amp;modem-&gt;slave, NULL, NULL, NULL)) {<BR>
<BR>
        if (modem-&gt;master &lt; 0) {<BR>
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Fatal error: failed to initialize pty\n&quot;);<BR>
                status = SWITCH_STATUS_FALSE;<BR>
                goto end;<BR>
    }<BR>
<BR>
        modem-&gt;stty = ttyname(modem-&gt;slave);<BR>
#else<BR>
<BR>
<BR>
I traced to the bottom of the function, and didn't see a matching close brace.  I believe it is the if(modem-&gt;master &lt; 0){ statement that is missing the closing } after the goto end; statement.<BR>
<BR>
Can a more knowledgeable developer confirm that this is correct.<BR>
<BR>
Ted<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_________________________________________________________________________<BR>
Professional FreeSWITCH Consulting Services:<BR>
<a href="consulting@freeswitch.org">consulting@freeswitch.org</a><BR>
<a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><BR>
<BR>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
<a href="http://www.cudatel.com">http://www.cudatel.com</a><BR>
<BR>
Official FreeSWITCH Sites<BR>
<a href="http://www.freeswitch.org">http://www.freeswitch.org</a><BR>
<a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a><BR>
<a href="http://www.cluecon.com">http://www.cluecon.com</a><BR>
<BR>
FreeSWITCH-dev mailing list<BR>
<a href="FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><BR>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><BR>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><BR>
<a href="http://www.freeswitch.org">http://www.freeswitch.org</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>