[Freeswitch-users] Compile error with FreeSwitch 1.2.11

Markus von Arx mkvonarx at gmail.com
Mon Jul 22 11:10:21 MSD 2013


Hi

I tried to update to FreeSwitch 1.2.11 but get the following compile error
(I'm compiling on Windows with Visual Studio 2012 Update 3):
d:\freeswitch\build\freeswitch-1.2.11\src\switch_ivr_async.c(1207): error
C2220: warning treated as error - no 'object' file generated
[D:\FreeSwitch\Build\freeswitch-1.2.11\w32\Library\FreeSwitchCore.2012.vcxproj]
d:\freeswitch\build\freeswitch-1.2.11\src\switch_ivr_async.c(1207): warning
C4701: potentially uninitialized local variable 'len' used
[D:\FreeSwitch\Build\freeswitch-1.2.11\w32\Library\FreeSwitchCore.2012.vcxproj]

Checking the source code of switch_ivr_async.c I think the compiler is
correct. In the source code, the lines 1213-1214 that contain the
initialization of 'len' should probably be moved to line 1204.

Also, the latest version of the file on github (
https://github.com/FreeSWITCH/FreeSWITCH/blob/master/src/switch_ivr_async.c)
looks exactly like this (fixed with a commit from 3 July 2013:
https://github.com/FreeSWITCH/FreeSWITCH/commit/02046950bebf84b6cf56f27321c3427718037c6b
).

=> What to do now with the 1.2.11 version? Will there be a 1.2.12 that
fixes this compiler error?

Here are the offending lines of code:
1136: static switch_bool_t record_callback(switch_media_bug_t *bug, void
*user_data, switch_abc_type_t type)
...
1143: switch_size_t len;
...
1199: case SWITCH_ABC_TYPE_TAP_NATIVE_WRITE:
1200: {
1201: switch_time_t now = switch_micro_time_now();
1202: switch_time_t diff;
1203: rh->wready = 1;
1204:
1205: if (!rh->rready) {
1206: unsigned char fill_data[SWITCH_RECOMMENDED_BUFFER_SIZE] = {0};
1207: switch_size_t fill_len = len;
1208: switch_core_gen_encoded_silence(fill_data, &rh->read_impl, len);
1209: switch_core_file_write(&rh->in_fh, fill_data, &fill_len);
1210: }
1211:
1212:
1213: nframe = switch_core_media_bug_get_native_write_frame(bug);
1214: len = nframe->datalen;
...

Regards, Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130722/88b0816a/attachment.html 


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