Closed Bug 939498 Opened 6 years ago Closed 6 years ago

use of std::max require including <algorithm> after bug 839310 (non-SPS)

Categories

(Core :: Security: PSM, defect)

26 Branch
x86
OpenBSD
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla28
Tracking Status
firefox26 --- verified
firefox27 --- verified
firefox28 --- verified
b2g-v1.2 --- fixed

People

(Reporter: gaston, Assigned: gaston)

References

Details

Attachments

(1 file)

26.0b3 builds fine, 26.0b5 fails with:

/usr/obj/ports/firefox-26.0beta5/mozilla-beta/security/manager/ssl/src/nsNSSIOLayer.cpp:691:22: error: 'max' is not a member of 'std' 
(with gcc 4.6/libstdc++ 4.6)

mozilla-beta/security/manager/ssl/src/nsNSSIOLayer.cpp:691:27: error: no member named 'max' in namespace 'std'
(with clang 3.3/libstdc++ 4.2)

http://hg.mozilla.org/releases/mozilla-beta/rev/83e55c91aa80 added std::max use but didnt change the includes. I dont know why it surfaces only on OpenBSD (and apparently not on my buildbot setup on aurora & central) but not the tier1 platforms, but slapping #include <algorithm> at the top of security/manager/ssl/src/nsNSSIOLayer.cpp fixes the issue for me.

Would it be an acceptable change for all branches to beta ? Does windows ship <algorithm> in their implem of libstdc++ ?
Blocks: 839310
Looking at $(CC) -E output on m-c the header is bootlegged as

  algorithm
  BaseRect.h
  Rect.h
  Units.h since bug 910322 (ff26)
  nsContentUtils.h since bug 898712 (ff27)
  nsNSSIOLayer.cpp

and there is also SPS vector (N/A for Linux/PPC, BSDs, Solaris)

  algorithm
  GeckoProfilerImpl.h
  GeckoProfiler.h
  StartupTimeline.h
  Telemetry.h
  nsNSSIOLayer.cpp
Summary: use of std::max require including <algorithm> after bug 839310 → use of std::max require including <algorithm> after bug 839310 (non-SPS)
Attached patch include fixSplinter Review
Which is more safe: add explicit <algorithm> or backport bug 898712 ?
Attachment #8333576 - Flags: review?(brian)
Comment on attachment 8333576 [details] [diff] [review]
include fix

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

Thank you!
Attachment #8333576 - Flags: review?(brian) → review+
Comment on attachment 8333576 [details] [diff] [review]
include fix

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 839310
User impact if declined: failure to build on non-SPS platforms
Testing completed (on m-c, etc.): just landed on inbound, but fixes the build of 26.0b5
Risk to taking this patch (and alternatives if risky): NPOTB
Attachment #8333576 - Flags: approval-mozilla-beta?
Attachment #8333576 - Flags: approval-mozilla-aurora?
Comment on attachment 8333576 [details] [diff] [review]
include fix

technically a=NPTOB, but approving here to make sure this gets uplift.
Attachment #8333576 - Flags: approval-mozilla-beta?
Attachment #8333576 - Flags: approval-mozilla-beta+
Attachment #8333576 - Flags: approval-mozilla-aurora?
Attachment #8333576 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/mozilla-central/rev/43a7e6c3df15
Assignee: nobody → landry
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Landry, can you please verify this is fixed in Firefox 26, 27 and 28?
Flags: needinfo?(landry)
26.0 built fine for me, and 27 & 28 too (since this was fixed in 26, no reason it would have regressed on that particular issue).
Flags: needinfo?(landry)
Thanks for the help, Landry.
You need to log in before you can comment on or make changes to this bug.