Closed Bug 1411605 Opened 7 years ago Closed 7 years ago

-Wclass-memaccess: clearing an object of non-trivial type 'struct webrtc::CodecSpecificInfo'

Categories

(Core :: WebRTC: Signaling, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: Sylvestre, Assigned: andi)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In file included from /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/media/webrtc/signaling/src/media-conduit/Unified_cpp_src_media-conduit0.cpp:38:0: /root/firefox-gcc-last/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp: In member function 'virtual int32_t mozilla::WebrtcGmpVideoEncoder::InitEncode(const webrtc::VideoCodec*, int32_t, uint32_t)': /root/firefox-gcc-last/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp:167:67: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct webrtc::CodecSpecificInfo'; use assignment or value-initialization instead [-Werror=class-memaccess] memset(&mCodecSpecificInfo, 0, sizeof(webrtc::CodecSpecificInfo)); ^
Depends on: 1411615
No longer depends on: 1411615
Assignee: nobody → dminor
Rank: 25
Priority: -- → P3
I don't understand why we do the memset on the entire object since it has a contructor and it initialises the first 2 members? Am i missing something obvious? I think we can only limit to do the memset on the union.
Assignee: dminor → nobody
Assignee: nobody → bpostelnicu
Attachment #8922246 - Flags: review+
Pushed by bpostelnicu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/30e090a9e408 don't memset the entire mCodecSpecificInfo. r=dminor
Attachment #8922246 - Flags: review?(rjesup)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: