Closed
Bug 557270
Opened 16 years ago
Closed 16 years ago
Build error in jstl.h on s390
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: glandium, Assigned: luke)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
|
3.30 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
On s390, the build fails with the following message:
jstl.h: In function 'size_t js::RoundUpPow2(size_t)':
jstl.h:198: error: 'result' in class 'js::tl::StaticAssert<false>' does not name a type
This is due to the fact that on s390, pointers are 31 bits (not 32), and as such, JSUword, which is a pointer to a long int, is not equal to size_t, which is 32 bits.
I don't know exactly what this test is supposed to acheive, as it was not there before bug 511750 in the code it replaced...
| Reporter | ||
Comment 1•16 years ago
|
||
Luke, Brendan, as you were both involved in bug 511750, would you have an answer to the last phrase in comment 0 ?
| Assignee | ||
Comment 2•16 years ago
|
||
The purpose of the static assert is to check the assumed parameter type of the JS_CEILING_LOG2W macro which is stated, in comments, to be JSUword. Vectors and things use a size_t, so one fix would be to change the parameter type of JS_{CEILING,FLOOR}_LOG2W and js_FloorLog2wImpl to be JSSize.
Assignee: general → lw
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•16 years ago
|
||
Mike: does this patch fix the build errors you are seeing?
| Reporter | ||
Comment 4•16 years ago
|
||
I could confirm it does.
| Assignee | ||
Updated•16 years ago
|
Attachment #437081 -
Flags: review?(brendan)
| Assignee | ||
Comment 5•16 years ago
|
||
Comment on attachment 437081 [details] [diff] [review]
tweak
Great; Brendan does this seem like the right fix to you? I guess the underlying issue is that jsuword means "an int that can be cast to and from a pointer" rather than "a machine-word-sized integer", which JSSize/size_t seem to mean.
Comment 6•16 years ago
|
||
Comment on attachment 437081 [details] [diff] [review]
tweak
JSSize, JSWord, etc. are the bad old "NSPR 2" names forked into JS in 1998 from NSPR. Apart from the old NSPR code forked then, we use size_t not JSSize. So please do use size_t if you can. I'm fine with it being the type for bit-fiddling, even if it is not big enough to hold a pointer. Most of our bit macrology works only for uint32, or rather, assumes at most 32 bits, anyway (check me if I'm misremembering).
/be
Attachment #437081 -
Flags: review?(brendan) → review+
| Assignee | ||
Comment 7•16 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/f72cc6add994
Oops, accidentally left in the StaticAssert that size_t == JSSize... will take that out on my next commit.
Whiteboard: fixed-in-tracemonkey
| Reporter | ||
Comment 8•16 years ago
|
||
(In reply to comment #7)
> http://hg.mozilla.org/tracemonkey/rev/f72cc6add994
>
> Oops, accidentally left in the StaticAssert that size_t == JSSize... will take
> that out on my next commit.
Well, it doesn't hurt.
| Assignee | ||
Comment 9•16 years ago
|
||
True, but since JS_CEILNG_LOG2W now takes a size_t it was a bit of a non sequitur.
Gone with http://hg.mozilla.org/tracemonkey/rev/3e7cbba99492
Comment 10•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•