diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 06:27:38 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 06:27:38 +0000 |
commit | 3b846396a90174835320be2ff50afe8dd4e31590 (patch) | |
tree | 78d7d4343f9e80d619cad10e8494be560a89daee /chrome/common | |
parent | cf13bb696f6a50b06930ed8fabb0984cd6af7be9 (diff) | |
download | chromium_src-3b846396a90174835320be2ff50afe8dd4e31590.zip chromium_src-3b846396a90174835320be2ff50afe8dd4e31590.tar.gz chromium_src-3b846396a90174835320be2ff50afe8dd4e31590.tar.bz2 |
Workaround bogus GCC warning
I had a single parameter IPC message handler, which took an enumeration
parameter. For some reason, GCC thought it was possible for the enum
value to be used uninitialized:
cc1plus: warnings being treated as errors
/b/slave/sub-rel-linux/build/src/chrome/common/ipc_message_utils.h: In member function 'virtual void RenderWidget::OnMessageReceived(const IPC::Message&)':
/b/slave/sub-rel-linux/build/src/chrome/common/ipc_message_utils.h:1244: warning: 'p.Tuple1<WebKit::WebTextDirection>::a' may be used uninitialized in this function
/b/slave/sub-rel-linux/build/src/chrome/common/ipc_message_utils.h:1244: note: 'p.Tuple1<WebKit::WebTextDirection>::a' was declared here
scons: *** [/b/slave/sub-rel-linux/build/src/sconsbuild/Release/obj/chrome/renderer/render_widget.o] Error 1
I am able to avoid this warning by adding an explicit branch.
BUG=none
TEST=none
TBR=mpcomplete
Review URL: http://codereview.chromium.org/155624
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/ipc_message_utils.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index 8661507..807fd9f 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -1233,9 +1233,10 @@ class MessageWithTuple : public Message { static bool Read(const Message* msg, Param* p) { void* iter = NULL; - bool rv = ReadParam(msg, &iter, p); - DCHECK(rv) << "Error deserializing message " << msg->type(); - return rv; + if (ReadParam(msg, &iter, p)) + return true; + NOTREACHED() << "Error deserializing message " << msg->type(); + return false; } // Generic dispatcher. Should cover most cases. |