Closed Bug 873585 Opened 11 years ago Closed 11 years ago

Issues with IsSigned/IsUnsigned

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
Compiling recently on gcc 4.5 (don't ask), it seems that the T(-1) < T(0) in TypeTraits.h with some compilers causes warnings specifically because less-than-zero with an unsigned type is considered vacuous by some compilers.  Changing to T(-1) < T(1) eliminates that -- so long as care is taken wrt T = bool, because bool(-1) == bool(1).  I believe I've taken the requisite care here, and tests should back that up.

But I also happened to note that that particular comparison isn't guarded against doing a floating point comparison, and floating point math isn't allowed in template parameter values.  So I did some adjustments to avoid that, and I added tests.
Attachment #751129 - Flags: review?(nfroyd)
Comment on attachment 751129 [details] [diff] [review]
Patch

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

\o/ for tests!
Attachment #751129 - Flags: review?(nfroyd) → review+
https://hg.mozilla.org/mozilla-central/rev/b0cb71ae891f
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: