Closed
Bug 609434
Opened 14 years ago
Closed 14 years ago
warning C4065: switch statement contains 'default' but no 'case' labels in IPC IPDL files
Categories
(Core :: IPC, defect)
Core
IPC
Tracking
()
RESOLVED
FIXED
mozilla5
People
(Reporter: RyanVM, Assigned: Mitch)
References
Details
(Whiteboard: [build_warning])
Attachments
(1 file)
3.74 KB,
patch
|
cjones
:
review+
|
Details | Diff | Splinter Review |
Warnings like the below are sprinkled throughout the build on Windows.
c:/mozbuild/mozilla-central/objdir-fx/ipc/ipdl/PTestDataStructuresSubParent.cpp(182) : warning C4065: switch statement contains 'default' but no 'case' labels
Code looks like this:
void
PTestDataStructuresSubParent::RemoveManagee(
int32 aProtocolId,
ChannelListener* aListener)
{
switch (aProtocolId) {
default:
{
NS_RUNTIMEABORT("unreached");
return;
}
}
}
Ben, any ideas on an approach to fixing this?
Reporter | ||
Updated•14 years ago
|
Whiteboard: [build_warning]
Sigh. I guess this isn't an entirely vacuous warning. We would need to fix this by adding yet another special case to the part of the IPDL compiler that generates this code [1]. Basically, just emit the abort when there aren't managees. I can hook up this patch but it's very far down my list right now.
[1] http://mxr.mozilla.org/mozilla-central/source/ipc/ipdl/ipdl/lower.py#3359
Reporter | ||
Comment 3•14 years ago
|
||
Chris, any chance that it's moved up higher on your list in the last 5 months? :-)
Not really, but the patch doesn't have to be written by me :).
Reporter | ||
Comment 5•14 years ago
|
||
What line # does this start on now? I don't believe the link in comment #1 is correct anymore.
Assignee | ||
Comment 6•14 years ago
|
||
Assignee: nobody → mitchell.field
Status: NEW → ASSIGNED
Attachment #522224 -
Flags: review?(jones.chris.g)
Comment on attachment 522224 [details] [diff] [review]
Patch
>+ else:
>+ default = StmtBlock()
>+ default.addstmts([ _runtimeAbort('unreached'), StmtReturn() ])
>+ switchontype.addcase(DefaultLabel(), default)
>+ removemanagee.addstmt(switchontype)
Drop the for-else, it doesn't make sense here. Just move this out in the same block as the for-stmt.
r=me with that.
Attachment #522224 -
Flags: review?(jones.chris.g) → review+
Assignee | ||
Comment 8•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
OS: Windows 7 → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
You need to log in
before you can comment on or make changes to this bug.
Description
•