Closed
Bug 623122
Opened 14 years ago
Closed 13 years ago
CurrentThreadId does not have a return for an unreachable exit path (missing return)
Categories
(Toolkit :: Crash Reporting, defect)
Tracking
()
RESOLVED
FIXED
mozilla2.0b10
People
(Reporter: espindola, Assigned: espindola)
References
Details
Attachments
(1 file, 1 obsolete file)
638 bytes,
patch
|
ted
:
review+
benjamin
:
approval2.0+
|
Details | Diff | Splinter Review |
CurrentThreadId is missing a returns which causes clang to produce a warning that because of -Werror=return-type causes the build to fail.
Assignee | ||
Updated•14 years ago
|
Attachment #501239 -
Attachment is patch: true
Attachment #501239 -
Attachment mime type: application/octet-stream → text/plain
Attachment #501239 -
Flags: review?(ted.mielczarek)
Assignee | ||
Updated•14 years ago
|
Blocks: clang-macosx
1959 CurrentThreadId() 1960 { 1961 #if defined(XP_WIN) 1962 return ::GetCurrentThreadId(); 1963 #elif defined(XP_LINUX) 1964 return sys_gettid(); 1965 #elif defined(XP_MACOSX) 1966 // Just return an index, since Mach ports can't be directly serialized 1967 thread_act_port_array_t threads_for_task; 1968 mach_msg_type_number_t thread_count; 1969 1970 if (task_threads(mach_task_self(), &threads_for_task, &thread_count)) 1971 return -1; 1972 1973 for (unsigned int i = 0; i < thread_count; ++i) { 1974 if (threads_for_task[i] == mach_thread_self()) 1975 return i; 1976 } 1977 #else 1978 # error "Unsupported platform" 1979 #endif 1980 } It's tempting to suggest abort() is better than return -1.
Summary: missing return → CurrentThreadId does not have a return for an unreachable exit path (missing return)
Comment 2•14 years ago
|
||
It kind of sucks either way, certainly, but these functions are incredibly unlikely to fail, so maybe an abort makes sense.
Comment 3•14 years ago
|
||
Rafael: FWIW, given how small all these patches are, I would have been fine with them all on one bug, like "fix CLang compilation issues in Breakpad".
Assignee: nobody → respindola
Assignee | ||
Comment 4•14 years ago
|
||
Attachment #501239 -
Attachment is obsolete: true
Attachment #501239 -
Flags: review?(ted.mielczarek)
Assignee | ||
Updated•14 years ago
|
Attachment #501414 -
Flags: review?(ted.mielczarek)
Updated•14 years ago
|
Attachment #501414 -
Flags: review?(ted.mielczarek) → review+
Updated•14 years ago
|
Attachment #501414 -
Flags: approval2.0?
Updated•13 years ago
|
Attachment #501414 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 5•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/b17f28507ab4
Status: NEW → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b10
You need to log in
before you can comment on or make changes to this bug.
Description
•