Closed Bug 777792 Opened 13 years ago Closed 13 years ago

Uninitialized variable in ParamTraits<nsMouseEvent>::Read

Categories

(Core :: Widget, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

Details

Attachments

(1 file)

Similar to bug 777734. ../../dist/include/IPC/nsGUIEventIPC.h:140:10: warning: variable 'exit' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized] rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../dist/include/IPC/nsGUIEventIPC.h:148:57: note: uninitialized use occurs here aResult->exit = static_cast<nsMouseEvent::exitType>(exit); ^~~~ ../../dist/include/IPC/nsGUIEventIPC.h:140:10: note: remove the '&&' if its condition is always true rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../dist/include/IPC/nsGUIEventIPC.h:140:10: warning: variable 'exit' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized] rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../dist/include/IPC/nsGUIEventIPC.h:148:57: note: uninitialized use occurs here aResult->exit = static_cast<nsMouseEvent::exitType>(exit); ^~~~ ../../dist/include/IPC/nsGUIEventIPC.h:140:10: note: remove the '&&' if its condition is always true rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../dist/include/IPC/nsGUIEventIPC.h:140:10: warning: variable 'exit' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized] rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../dist/include/IPC/nsGUIEventIPC.h:148:57: note: uninitialized use occurs here aResult->exit = static_cast<nsMouseEvent::exitType>(exit); ^~~~ ../../dist/include/IPC/nsGUIEventIPC.h:140:10: note: remove the '&&' if its condition is always true rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../dist/include/IPC/nsGUIEventIPC.h:140:10: warning: variable 'exit' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized] rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../dist/include/IPC/nsGUIEventIPC.h:148:57: note: uninitialized use occurs here aResult->exit = static_cast<nsMouseEvent::exitType>(exit); ^~~~ ../../dist/include/IPC/nsGUIEventIPC.h:140:10: note: remove the '&&' if its condition is always true rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../dist/include/IPC/nsGUIEventIPC.h:139:34: note: initialize the variable 'exit' to silence this warning PRUint8 reason, context, exit; ^ = '\0' Same for reason and context.
Attached patch Patch (v1)Splinter Review
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #646212 - Flags: review?(jones.chris.g)
Comment on attachment 646212 [details] [diff] [review] Patch (v1) r+ for the same reason, to make the warnings shut up.
Attachment #646212 - Flags: review?(jones.chris.g) → review+
Target Milestone: --- → mozilla17
Status: ASSIGNED → RESOLVED
Closed: 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: