Skip to content

Commit

Permalink
[core] Fixed a warning: member referenced before initialized (#2433).
Browse files Browse the repository at this point in the history
CPacket::m_nHeader is default-initialized.
But GCC12 produces a warning.
  • Loading branch information
maxsharabayko authored Dec 5, 2022
1 parent fc82eac commit 3d517cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion srtcore/packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ namespace srt {

// Set up the aliases in the constructure
CPacket::CPacket()
: m_extra_pad()
: m_nHeader() // Silences GCC 12 warning "used uninitialized".
, m_extra_pad()
, m_data_owned(false)
, m_iSeqNo((int32_t&)(m_nHeader[SRT_PH_SEQNO]))
, m_iMsgNo((int32_t&)(m_nHeader[SRT_PH_MSGNO]))
Expand Down

0 comments on commit 3d517cf

Please sign in to comment.