Closed Bug 787040 Opened 12 years ago Closed 12 years ago

eliminate warnings under ipc/

Categories

(Core :: IPC, defect)

All
OpenBSD
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: gaston, Assigned: gaston)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #786372 +++

ipc compilation with gcc 4.6 (since ipc uses -pedantic) spews warnings like:

ipc/chromium/src/base/ref_counted.h:31:28: warning: extra ';' [-pedantic]
ipc/chromium/src/chrome/common/file_descriptor_set_posix.h:33:36: warning: comma at end of enumerator list [-pedantic]

let's fix them for nice build logs.
All uses of HANDLE_EINTR also yields :

ipc/chromium/src/base/process_util_posix.cc:335:19: warning: ISO C++ forbids braced-groups within expressions [-pedantic]
ipc/chromium/src/base/process_util_posix.cc:355:15: warning: ISO C++ forbids braced-groups within expressions [-pedantic]
ipc/chromium/src/base/process_util_posix.cc:370:24: warning: ISO C++ forbids braced-groups within expressions [-pedantic]
ipc/chromium/src/base/process_util_posix.cc:511:15: warning: ISO C++ forbids braced-groups within expressions [-pedantic]
As for the HANDLE_EINTR, there are two cases :
if i remove the braces around its definition, when 'return HANDLE_EINTR()' is used it now barfs with 

ipc/chromium/src/base/file_descriptor_shuffle.cc: In member function 'virtual bool base::FileDescriptorTableInjection::Duplicate(int*, int)':
ipc/chromium/src/base/file_descriptor_shuffle.cc:82:13: error: expected primary-expression before 'typeof'
ipc/chromium/src/base/file_descriptor_shuffle.cc:82:13: error: expected '}' before 'typeof'
ipc/chromium/src/base/file_descriptor_shuffle.cc:82:13: error: cannot convert '<brace-enclosed initializer list>' to 'int' in assignment
ipc/chromium/src/base/file_descriptor_shuffle.cc:82:13: error: expected ';' before 'typeof'
ipc/chromium/src/base/file_descriptor_shuffle.cc:82:13: error: '__eintr_result__' was not declared in this scope
ipc/chromium/src/base/file_descriptor_shuffle.cc:82:13: error: '__eintr_result__' was not declared in this scope
ipc/chromium/src/base/file_descriptor_shuffle.cc:82:13: error: no return statement in function returning non-void [-Werror=return-type]

readding braces around the macro 'fixes' it but it's ugly. (ie return (HANDLE_EINTR(xxx)); )

The other option would be to 'fix' the other callers where the return value is used (ie foo = HANDLE_EINTR(xxx); ) but i dont know how.
I give up on HANDLE_EINTR, even if i move braces around some of the users still yield 'warning: ISO C++ forbids braced-groups within expressions'
Attached patch shut up some warnings (obsolete) — Splinter Review
Not all warnings are fixed, but at least there's not a vomit at each file built under ipc/.
Assignee: nobody → landry
Attachment #656940 - Flags: review?(Ms2ger)
Comment on attachment 656940 [details] [diff] [review]
shut up some warnings

Review of attachment 656940 [details] [diff] [review]:
-----------------------------------------------------------------

Can you fix the other cases of http://mxr.mozilla.org/mozilla-central/ident?i=DFAKE_MUTEX&filter= too?
Attachment #656940 - Attachment is obsolete: true
Attachment #656940 - Flags: review?(Ms2ger)
Attachment #656976 - Flags: review?(Ms2ger)
Comment on attachment 656976 [details] [diff] [review]
silence some warnings incl in unittests

Review of attachment 656976 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.
Attachment #656976 - Flags: review?(Ms2ger) → review+
https://hg.mozilla.org/mozilla-central/rev/a42606a108e6
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: