[Freeswitch-dev] Maybe bug in switch_rtp.c?

Lawrence Conroy lconroy at insensate.co.uk
Tue Jul 31 03:54:42 MSD 2012


Hi folks,
 at the risk of irritating everyone by not *starting* with a JIRA ...

I've just been building on MAC OS X 10.6 from git (version as of 120730 at 22:36 GMT) -- commit 0f4ecab5e9d3ad765ee266f1af41560df5f434ae[0f4ecab].

The make reports an error when compiling switch_rtp.c (line 3314).

Is this me, my whacko MBP, or is this (as would seem) a bug?

..............................................................................
cc1: warnings being treated as errors
src/switch_rtp.c: In function ‘rtp_common_read’:
src/switch_rtp.c:3314: warning: format ‘%s’ expects type ‘char *’, but argument 9 has type ‘int’
make[1]: *** [libfreeswitch_la-switch_rtp.lo] Error 1

Ugly Quick hack ... changed it to show the int result of strerror_r and then the string
-> add an %i before the [%s] in the format, and then put ,tmp after the strerror_r call.
Is now:
	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Poll failed with error: %d %i [%s]\n",
		poll_status, strerror_r(poll_status, tmp, sizeof(tmp)), tmp);

builds OK (but maaaan, someone else needs to write something that doesn't make the eyes bleed).
..............................................................................

I guess this may be because of a switch from using strerror to the thread-safe strerror_r function.


all the best,
  Lawrence


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