Closed Bug 803236 Opened 12 years ago Closed 12 years ago

build warnings for init list order of nsSTSHostEntry

Categories

(Core :: Security, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Reporting build warnings:
{
478.33 In file included from /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.cpp:13:0:
478.34 /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h: In constructor 'nsSTSHostEntry::nsSTSHostEntry(const char*)':
478.34 Warning: -Wreorder in /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h: 'nsSTSHostEntry::mExpired' will be initialized after
478.34 /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h:66:10: warning: 'nsSTSHostEntry::mExpired' will be initialized after [-Wreorder]
478.34 Warning: -Wreorder in /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h:   'uint32_t nsSTSHostEntry::mStsPermission'
478.34 /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h:65:14: warning:   'uint32_t nsSTSHostEntry::mStsPermission' [-Wreorder]
478.34 Warning: -Wreorder in /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.cpp:   when initialized here
478.34 /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.cpp:49:1: warning:   when initialized here [-Wreorder]


478.34 In file included from /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.cpp:13:0:
478.34 /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h: In copy constructor 'nsSTSHostEntry::nsSTSHostEntry(const nsSTSHostEntry&)':
478.34 Warning: -Wreorder in /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h: 'nsSTSHostEntry::mExpired' will be initialized after
478.34 /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h:66:10: warning: 'nsSTSHostEntry::mExpired' will be initialized after [-Wreorder]
478.34 Warning: -Wreorder in /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h:   'uint32_t nsSTSHostEntry::mStsPermission'
478.34 /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.h:65:14: warning:   'uint32_t nsSTSHostEntry::mStsPermission' [-Wreorder]
478.34 Warning: -Wreorder in /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.cpp:   when initialized here
478.34 /mozilla/security/manager/boot/src/nsStrictTransportSecurityService.cpp:58:1: warning:   when initialized here [-Wreorder]
}

The 2 nsSTSHostEntry() constructors just have their init lists out of order w.r.t. the .h file.   (mStsPermission should come before mExpired)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
This fixes the build warnings, and marks the directory as warning-free, since this was the only warning in my local debug build. (so that any additional warnings introduced here will turn tinderbox red)
Attachment #672912 - Flags: review?
Attachment #672912 - Flags: review? → review?(dkeeler)
Comment on attachment 672912 [details] [diff] [review]
fix (and mark directory as warning-free)

Review of attachment 672912 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good. I'm not a PSM peer, so technically you need two more reviews, but I think if Brian (or another peer that has more time) has a quick look, that'll be fine.
Attachment #672912 - Flags: review?(dkeeler)
Attachment #672912 - Flags: review?(bsmith)
Attachment #672912 - Flags: feedback+
Updated the patch to also mark the sibling-directory "pki/src" as warning-free, since it is, at least on my machine w/ gcc 4.7. Here's a TBPL run showing that this is fine there as well:
  https://tbpl.mozilla.org/?tree=Try&rev=041a50929ffe

(BTW: I tried marking /ssl/src as warning-free, too -- that's the only other directory within /security/manager that has .cpp files -- but that didn't work, because it has a few build warnings.)
Attachment #672912 - Attachment is obsolete: true
Attachment #672912 - Flags: review?(bsmith)
Attachment #672980 - Flags: review?(bsmith)
Comment on attachment 672980 [details] [diff] [review]
fix v2 (also marking security/manager/pki/src/ as warning-free)

Review of attachment 672980 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for doing this. I will make ssl/ warnings-free too soon.
Attachment #672980 - Flags: review?(bsmith) → review+
https://hg.mozilla.org/mozilla-central/rev/c14d2bf709ca
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: