Closed Bug 854085 Opened 13 years ago Closed 13 years ago

error: variable 'rv' set but not used [-Werror=unused-but-set-variable] with gcc 4.7

Categories

(Core :: WebRTC, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: glandium, Assigned: glandium)

References

Details

(Whiteboard: [qa-])

Attachments

(2 files, 1 obsolete file)

nr_socket_prsock.cpp: In member function 'int mozilla::NrSocket::sendto(const void*, size_t, int, nr_transport_addr*)': nr_socket_prsock.cpp:380:44: error: variable 'rv' set but not used [-Werror=unused-but-set-variable] nr_socket_prsock.cpp: In member function 'int mozilla::NrSocket::recvfrom(void*, size_t, size_t*, int, nr_transport_addr*)': nr_socket_prsock.cpp:407:44: error: variable 'rv' set but not used [-Werror=unused-but-set-variable] nr_socket_prsock.cpp: In member function 'int mozilla::NrSocket::getaddr(nr_transport_addr*)': nr_socket_prsock.cpp:430:44: error: variable 'rv' set but not used [-Werror=unused-but-set-variable] nr_socket_prsock.cpp: In member function 'void mozilla::NrSocket::close()': nr_socket_prsock.cpp:436:44: error: variable 'rv' set but not used [-Werror=unused-but-set-variable] nriceresolver.cpp: In member function 'int mozilla::NrIceResolver::resolve(nr_resolver_resource*, int (*)(void*, nr_transport_addr*), void*, void**)': nriceresolver.cpp:153:45: error: variable 'rv' set but not used [-Werror=unused-but-set-variable] nriceresolver.cpp: In member function 'virtual nsresult mozilla::NrIceResolver::PendingResolution::OnLookupComplete(nsICancelable*, nsIDNSRecord*, nsresult)': nriceresolver.cpp:183:41: error: variable 'rv' set but not used [-Werror=unused-but-set-variable] nriceresolver.cpp: In static member function 'static int mozilla::NrIceResolver::cancel(void*, void*)': nriceresolver.cpp:206:80: error: variable 'rv' set but not used [-Werror=unused-but-set-variable] This can be tested on try with: --- a/build/unix/mozconfig.linux +++ b/build/unix/mozconfig.linux @@ -1,4 +1,4 @@ . "$topsrcdir/build/mozconfig.common" -CC=/tools/gcc-4.5-0moz3/bin/gcc -CXX=/tools/gcc-4.5-0moz3/bin/g++ +CC=/tools/gcc-4.7.2-0moz1/bin/gcc +CXX=/tools/gcc-4.7.2-0moz1/bin/g++
Assignee: nobody → mh+mozilla
Comment on attachment 728624 [details] [diff] [review] Fix unused-but-set-variable from ASSERT_ON_THREAD macro in media/mtransport/runnable_utils.h Wouldn't making 'rv' DebugOnly just make 'on' unused as well? Shouldn't ASSERT_ON_THREAD() just do nothing if not debug?
(In reply to Dave Garrett from comment #2) > Comment on attachment 728624 [details] [diff] [review] > Fix unused-but-set-variable from ASSERT_ON_THREAD macro in > media/mtransport/runnable_utils.h > > Wouldn't making 'rv' DebugOnly just make 'on' unused as well? Strangely, gcc 4.7 doesn't complain. > Shouldn't ASSERT_ON_THREAD() just do nothing if not debug? Mmmmm probably.
Attachment #728624 - Attachment is obsolete: true
Attachment #728624 - Flags: review?(rjesup)
Comment on attachment 728643 [details] [diff] [review] Fix unused-but-set-variable from ASSERT_ON_THREAD macro in media/mtransport/runnable_utils.h Review of attachment 728643 [details] [diff] [review]: ----------------------------------------------------------------- r-. we'll need to leave the RUN_ON_THREAD stuff to be on in production builds as webrtc thread assertions if violated can lead to security issues, and per discussions with dveditz we want to leave them on in opt/production builds "for a while" at least. r+ without that change (i.e. r+ the previous patch).
Attachment #728643 - Flags: review?(rjesup) → review-
Comment on attachment 728643 [details] [diff] [review] Fix unused-but-set-variable from ASSERT_ON_THREAD macro in media/mtransport/runnable_utils.h Review of attachment 728643 [details] [diff] [review]: ----------------------------------------------------------------- r+ actually - the assertions haven't been changed to be enabled opt/production yet, and thus the patch as it stands is correct.
Attachment #728643 - Flags: review- → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Whiteboard: [qa-]
Flags: in-testsuite-
Blocks: gcc-4.7
Attachment #738082 - Flags: review?(rjesup)
MOZ_ASSERT is conditional on DEBUG not MOZ_DEBUG
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #738082 - Flags: review?(rjesup) → review+
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: