Closed Bug 557270 Opened 16 years ago Closed 16 years ago

Build error in jstl.h on s390

Categories

(Core :: JavaScript Engine, defect)

Other
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: glandium, Assigned: luke)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

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...
Luke, Brendan, as you were both involved in bug 511750, would you have an answer to the last phrase in comment 0 ?
Attached patch tweak — — Splinter Review
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
Mike: does this patch fix the build errors you are seeing?
I could confirm it does.
Attachment #437081 - Flags: review?(brendan)
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 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+
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
(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.
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
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.

Attachment

General

Created:
Updated:
Size: