GCC init list ordering build warning for MessageLoop in message_loop.cc

RESOLVED FIXED in mozilla23

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla23
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Build warning:
{
In file included from /mozilla-central/ipc/chromium/src/base/message_loop.cc:5:0:
/mozilla-central/ipc/chromium/src/base/message_loop.h: In constructor 'MessageLoop::MessageLoop(MessageLoop::Type)':
/mozilla-central/ipc/chromium/src/base/message_loop.h:424:7: warning: 'MessageLoop::next_sequence_num_' will be initialized after [-Wreorder]
   int next_sequence_num_;
       ^
In file included from /mozilla-central/ipc/chromium/src/base/message_loop.cc:5:0:
/mozilla-central/ipc/chromium/src/base/message_loop.h:380:11: warning:   'PRInt32 MessageLoop::id_' [-Wreorder]
   PRInt32 id_;
           ^
/mozilla-central/ipc/chromium/src/base/message_loop.cc:91:1: warning:   when initialized here [-Wreorder]
 MessageLoop::MessageLoop(Type type)
 ^
}

The "id_" member-var was added in this cset for bug 857152:
  http://hg.mozilla.org/mozilla-central/rev/c97f19dc7f7f
but it was put into the wrong place in the init list.

Patch coming up.
(Assignee)

Comment 1

6 years ago
Created attachment 741931 [details] [diff] [review]
fix v1

id_ is declared immediately after type_, as shown here:

> 379   Type type_;
> 380   PRInt32 id_;
http://mxr.mozilla.org/mozilla-central/source/ipc/chromium/src/base/message_loop.h#379

This patch reorders the init list to initialize it after type_, to match.
Attachment #741931 - Flags: review?(justin.lebar+bug)
Attachment #741931 - Flags: review?(justin.lebar+bug) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/06927647efd7
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.