[Freeswitch-dev] error in mod_spandsp_modem.c

Ted Walther tederific at gmail.com
Wed May 9 01:49:25 MSD 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20120508/67668f59/attachment.html 


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