]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: Eliminate "type-punned pointer" build warning.
authorDavid M. Lee <dlee@digium.com>
Mon, 10 Sep 2012 19:19:50 +0000 (19:19 +0000)
committerDavid M. Lee <dlee@digium.com>
Mon, 10 Sep 2012 19:19:50 +0000 (19:19 +0000)
commit95563e7890aa02ef151854cfbc3ac800bc43720f
treef875a273bf124ea6677989525612c41584c5ea71
parentf1a70f36b6584ab4da3873194f8e6ef654f12a0c
res_rtp_asterisk: Eliminate "type-punned pointer" build  warning.

Removes "res_rtp_asterisk.c:706: warning: dereferencing type-punned pointer
will break strict-aliasing rules" warning from the build on 32-bit platforms.

The problem is that 'size' was referenced aliased to both (pj_size_t *) and
(pj_ssize_t *). Now just make a copy of size that is the right type so there
isn't any pointer aliasing happening.

It also adds comments and asserts regarding what looks like an inappropriate
use of pj_sock_sendto, but is actually totally fine.

(closes issue ASTERISK-20368)
Reported by: Shaun Ruffell
Tested by: Michael L. Young
Patches:
  0001-res_rtp_asterisk-Eliminate-type-punned-pointer-build.patch uploaded by Shaun Ruffell (license 5417)
    slightly modified by David M. Lee.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@372777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_rtp_asterisk.c