Closed Bug 1189894 Opened 9 years ago Closed 9 years ago

remove Atomics.h IntrinsicAddSub hack

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

This hack was only required for broken headers in GCC 4.6.  Since we
only support GCC 4.7+ now, this hack is no longer necessary.
Hooray for removing obsolete code.  Eric requested to review more code, so
giving this one to him!
Attachment #8641817 - Flags: review?(erahm)
Comment on attachment 8641817 [details] [diff] [review]
remove Atomics.h IntrinsicAddSub hack

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

r=me. It might be good to see a try run w/ the cppunittests just for sanity (assuming |TestPointerWithOrdering| [1] covers this case).

[1] https://hg.mozilla.org/mozilla-central/annotate/2ddec2dedced/mfbt/tests/TestAtomics.cpp#l87

::: mfbt/Atomics.h
@@ +265,5 @@
>  {
>    typedef IntrinsicBase<T*, Order> Base;
>  
>    static T* add(typename Base::ValueType& aPtr, ptrdiff_t aVal)
>    {

Should we add a compiler error if someone tries to use GCC < 4.7, or do we consider wherever it's documented that you need 4.7+ to be good enough?
Attachment #8641817 - Flags: review?(erahm) → review+
(In reply to Eric Rahm [:erahm] (out until 8/3) from comment #2)
> ::: mfbt/Atomics.h
> @@ +265,5 @@
> >  {
> >    typedef IntrinsicBase<T*, Order> Base;
> >  
> >    static T* add(typename Base::ValueType& aPtr, ptrdiff_t aVal)
> >    {
> 
> Should we add a compiler error if someone tries to use GCC < 4.7, or do we
> consider wherever it's documented that you need 4.7+ to be good enough?

That's an excellent question; we already have such a check, in an #include that Atomics.h uses, among other files:

http://mxr.mozilla.org/mozilla-central/source/mfbt/Compiler.h#26
We also reject gcc < 4.7 in configure.
https://hg.mozilla.org/mozilla-central/rev/d50e76df21a5
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: