[Freeswitch-dev] error in mod_spandsp_modem.c

Ted Walther tederific at gmail.com
Wed May 9 06:29:17 MSD 2012


I found it on openbsd. Putting the closing brace in, fixed the compile. I
dont think it was specific to openbsd. I did find a few openbsd specific
things today, of which more anon.
 On May 8, 2012 7:22 PM, "Ken Rice" <krice at freeswitch.org> wrote:

>  What platform is this on? You need to be specific when reporting these
> types of errors....
>
>
> On 5/8/12 4:49 PM, "Ted Walther" <tederific at gmail.com> wrote:
>
> Compiling mod_spandsp_modem.c ...
> cc1: warnings being treated as errors
> mod_spandsp_modem.c: In function 'modem_init':
> mod_spandsp_modem.c:380: warning: ISO C90 forbids mixed declarations and
> code
> mod_spandsp_modem.c:398: error: invalid storage class for function
> 'channel_on_init'
> mod_spandsp_modem.c:399: error: invalid storage class for function
> 'channel_on_hangup'
> mod_spandsp_modem.c:400: error: invalid storage class for function
> 'channel_on_destroy'
> mod_spandsp_modem.c:401: error: invalid storage class for function
> 'channel_on_routing'
> mod_spandsp_modem.c:402: error: invalid storage class for function
> 'channel_on_exchange_media'
> mod_spandsp_modem.c:403: error: invalid storage class for function
> 'channel_on_soft_execute'
> mod_spandsp_modem.c:407: error: invalid storage class for function
> 'channel_outgoing_channel'
> mod_spandsp_modem.c:408: error: invalid storage class for function
> 'channel_read_frame'
> mod_spandsp_modem.c:409: error: invalid storage class for function
> 'channel_write_frame'
> mod_spandsp_modem.c:410: error: invalid storage class for function
> 'channel_kill_channel'
> mod_spandsp_modem.c:419: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:419: error: invalid storage class for function
> 'channel_on_init'
> mod_spandsp_modem.c: In function 'channel_on_init':
> mod_spandsp_modem.c:445: warning: implicit declaration of function 'ioctl'
> mod_spandsp_modem.c: In function 'modem_init':
> mod_spandsp_modem.c:489: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:489: error: invalid storage class for function
> 'channel_on_routing'
> mod_spandsp_modem.c:503: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:503: error: invalid storage class for function
> 'channel_on_execute'
> mod_spandsp_modem.c:519: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:519: error: invalid storage class for function
> 'channel_on_destroy'
> mod_spandsp_modem.c:543: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:543: error: invalid storage class for function
> 'channel_on_hangup'
> mod_spandsp_modem.c:560: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:560: error: invalid storage class for function
> 'channel_kill_channel'
> mod_spandsp_modem.c:586: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:586: error: invalid storage class for function
> 'channel_on_soft_execute'
> mod_spandsp_modem.c:592: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:592: error: invalid storage class for function
> 'channel_on_exchange_media'
> mod_spandsp_modem.c:608: warning: ISO C forbids nested functions
> mod_spandsp_modem.c:608: error: invalid storage class for function
> 'channel_on_reset'
>
> It looks to me like the error is here:
>
> #if USE_OPENPTY
>     if (openpty(&modem->master, &modem->slave, NULL, NULL, NULL)) {
>
>         if (modem->master < 0) {
>                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
> "Fatal error: failed to initialize pty\n");
>                 status = SWITCH_STATUS_FALSE;
>                 goto end;
>     }
>
>         modem->stty = ttyname(modem->slave);
> #else
>
>
> I traced to the bottom of the function, and didn't see a matching close
> brace.  I believe it is the if(modem->master < 0){ statement that is
> missing the closing } after the goto end; statement.
>
> Can a more knowledgeable developer confirm that this is correct.
>
> Ted
>
> ------------------------------
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20120508/b67e2a19/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list