Closed Bug 612777 Opened 14 years ago Closed 11 years ago

MSVC warning on jsscope.cpp:926/data type for 'attrs'

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 610480

People

(Reporter: dmandelin, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

This warning is kind of stubborn:

c:/sources/tracemonkey/js/src/jsscope.cpp(926) : warning C4242: '=' : conversion from 'uintN' to 'uint8', possible loss of data

We get this because Shape::attrs is uint8, but the argument type for all of our attribute-taking functions is uintN. That doesn't seem right.

The 'obvious' solution is to put 'typedef uint8 JSPropAttrs' into jsapi.h and use that everywhere. But we do have one attributes flag, JSPROP_SHORTID, that doesn't fit in 8 bits (it is 0x100). It seems to be used only in jsproxy.cpp, which uses |uintN PropertyDescriptor::attrs|. 

So, is |uint8 Shape::attrs| a bug? Or do we have two different attribute types?
Whiteboard: [build_warning]
Blocks: buildwarning
This same warning was mentioned in Bug 610480 (although with a 5 line difference). Bug 610480 is fixed, so marking as duplicate.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.