From 1e86aa6ec38166adb003fc6359c0fe85f63a71c9 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Fri, 24 Apr 2009 21:22:33 +0000 Subject: Add a gcc warning if we don't check the results of ReadParam. Some of the buildbots noticed that we weren't checking the results when generating log output. AGL gets the credit for tracking this down. Review URL: http://codereview.chromium.org/93126 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14475 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/ipc_message_utils.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'chrome/common/ipc_message_utils.h') diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index 8e4e8a5..3438e52 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -121,7 +121,8 @@ static inline void WriteParam(Message* m, const P& p) { } template -static inline bool ReadParam(const Message* m, void** iter, P* p) { +static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, void** iter, + P* p) { return ParamTraits

::Read(m, iter, p); } @@ -1267,8 +1268,8 @@ class MessageWithReply : public SyncMessage { if (msg->is_sync()) { SendParam p; void* iter = SyncMessage::GetDataIterator(msg); - ReadParam(msg, &iter, &p); - LogParam(p, l); + if (ReadParam(msg, &iter, &p)) + LogParam(p, l); #if defined(IPC_MESSAGE_LOG_ENABLED) const std::wstring& output_params = msg->output_params(); @@ -1282,8 +1283,8 @@ class MessageWithReply : public SyncMessage { // can finally log the message. typename ReplyParam::ValueTuple p; void* iter = SyncMessage::GetDataIterator(msg); - ReadParam(msg, &iter, &p); - LogParam(p, l); + if (ReadParam(msg, &iter, &p)) + LogParam(p, l); } } -- cgit v1.1