xpidl allows "const unsigned long bar = -4;"

RESOLVED FIXED

Status

()

Core
XPCOM
P3
minor
RESOLVED FIXED
18 years ago
10 years ago

People

(Reporter: Michael Ang, Assigned: Mike McCabe)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

18 years ago
xpidl allows having a constant that is marked both as unsigned and having a
negative value.

If you have this in your .idl:
const unsigned long bar = -4;

In your .h you'll get:
enum { foo = 18446744073709551574U };

And through XPConnect:
js> Components.interfaces.nsISample.foo
-42

I guess we should flag an error in xpidl if the user makes a declaration that is
mismatched?  The declaration does makes sense, since the size of our types is
well defined.  If we want to support the declaration then our XPConnect
behaviour is incorrect.  Not sure what the behaviour in OMG IDL is.
(Reporter)

Updated

18 years ago
Severity: normal → minor
(Reporter)

Comment 1

18 years ago
For some reason this bug doesn't show up when I do a bugzilla query for
component "xpidl" or query on "mang" email substring.

dmose, any idea why?  I submitted using a recent build of the tip and I think I
pressed "commit" more than once (oops).

Comment 2

18 years ago
Works for me.  I assume you remembered to set the checkbox that said "reporter"
since the default is "assigned to"?
(Reporter)

Comment 3

18 years ago
I did have reporter set.  The bug also now appears when searching on the "xpidl"
component, which it didn't before.  Weird.

(De-cc'ing dmose)
(Assignee)

Comment 4

18 years ago
Created attachment 19934 [details] [diff] [review]
check against unsigned negative consts, and centralize checking in xpidl_util
(Assignee)

Comment 5

18 years ago
Created attachment 19935 [details] [diff] [review]
as above, with changes for xpidl_java.c
(Assignee)

Comment 6

18 years ago
This set of changes is just a little more pervasive.

r=jband? r=mang?
(Assignee)

Comment 7

18 years ago
Created attachment 19964 [details] [diff] [review]
as above, with comment fix.

Comment 8

18 years ago
sr=jband
(Assignee)

Comment 9

18 years ago
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Updated

10 years ago
Component: xpidl → XPCOM
QA Contact: mike+mozilla → xpcom
You need to log in before you can comment on or make changes to this bug.