Closed
Bug 516623
Opened 15 years ago
Closed 15 years ago
jsnum.cpp:87: warning: integer overflow in expression
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta1-fixed |
People
(Reporter: mrbkap, Assigned: Waldo)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(2 files)
1.53 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
2.48 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
This is due to: JS_STATIC_ASSERT(int32_t(INT32_MAX + 1) == INT32_MIN); and related assertions. While it's always nice to have sanity checks, I don't think these assertions are worth the warning.
Assignee | ||
Comment 1•15 years ago
|
||
Kills asserts when stdint.h is used (good compilers), silences warnings when MSVC (bad compiler) is used (tested on mini on my desk), should cover everybody, I think -- and even if not, out of sight, out of mind.
Reporter | ||
Comment 2•15 years ago
|
||
Comment on attachment 400657 [details] [diff] [review] Patch Thanks.
Attachment #400657 -
Flags: review?(mrbkap) → review+
Comment 3•15 years ago
|
||
(In reply to comment #0) > This is due to: > > JS_STATIC_ASSERT(int32_t(INT32_MAX + 1) == INT32_MIN); > > and related assertions. While it's always nice to have sanity checks, I don't > think these assertions are worth the warning. The assert should use unsigned arithmetic like in: JS_STATIC_ASSERT(uint32_t(INT32_MAX + 1) == uint32_t(INT32_MIN)); C/C++ standards does not specify the behavior of int arithmetic regarding the overflow while they explicitly state the wrap around for unsigned types.
Comment 4•15 years ago
|
||
(In reply to comment #3) > (In reply to comment #0) > The assert should use unsigned arithmetic like in: > > JS_STATIC_ASSERT(uint32_t(INT32_MAX + 1) == uint32_t(INT32_MIN)); I meant: JS_STATIC_ASSERT(uint32_t(INT32_MAX) + uint32_t(1) == uint32_t(INT32_MIN));
Assignee | ||
Comment 5•15 years ago
|
||
Attachment #400837 -
Flags: review?(mrbkap)
Reporter | ||
Updated•15 years ago
|
Attachment #400837 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 6•15 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/467758d5e9f1 http://hg.mozilla.org/tracemonkey/rev/af2c906d75a8
OS: Linux → All
Hardware: x86 → All
Whiteboard: fixed-in-tracemonkey
Reporter | ||
Comment 7•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/467758d5e9f1 http://hg.mozilla.org/mozilla-central/rev/af2c906d75a8
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•15 years ago
|
status1.9.2:
--- → beta1-fixed
Flags: wanted1.9.2+
You need to log in
before you can comment on or make changes to this bug.
Description
•