Closed
Bug 224678
Opened 21 years ago
Closed 19 years ago
nsComposerRegistration.cpp has suspicious code
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
People
(Reporter: mmokrejs, Assigned: timeless)
References
Details
Attachments
(2 obsolete files)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030826
Build Identifier:
Hi,
I get the following with current snapshot on Tru64 Unix 5.1A:
cxx: Warning: nsComposerRegistration.cpp, line 59: integer conversion resulted
in truncation
static NS_DEFINE_CID(kHTMLEditorCommandTableCID, NS_HTMLEDITOR_COMMANDTABLE_CID);
-------^
cxx: Warning: nsComposerRegistration.cpp, line 60: integer conversion resulted
in truncation
static NS_DEFINE_CID(kHTMLEditorDocStateCommandTableCID,
NS_HTMLEDITOR_DOCSTATE_COMMANDTABLE_CID);
-------^
cxx: Warning: nsComposerRegistration.cpp, line 229: integer conversion resulted
in truncation
{ "HTML Editor command table", NS_HTMLEDITOR_COMMANDTABLE_CID,
-----------------------------------^
cxx: Warning: nsComposerRegistration.cpp, line 233: integer conversion resulted
in truncation
{ "HTML Editor doc state command table",
NS_HTMLEDITOR_DOCSTATE_COMMANDTABLE_CID,
---------------------------------------------^
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Reporter | ||
Comment 1•21 years ago
|
||
Similarly, I get:
cxx: Warning: nsEditorRegistration.cpp, line 60: integer conversion resulted in
truncation
static NS_DEFINE_CID(kEditorCommandTableCID, NS_EDITORCOMMANDTABLE_CID);
-------^
cxx: Warning: nsEditorRegistration.cpp, line 154: integer conversion resulted
in truncation
{ "Editor Command Table", NS_EDITORCOMMANDTABLE_CID,
------------------------------^
Comment 2•21 years ago
|
||
*** Bug 224677 has been marked as a duplicate of this bug. ***
Comment 3•21 years ago
|
||
Editor, not localization. The problem, of course, is that the CID format used
in Mozilla is:
{ 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
while the CIDs in question use
{ 0x00000000, 0x0000, 0x0000, { 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
(so the first element of the sub-array does not fit in the PRUint8 it's assigned
into, and the last element does not exist).
I'm actually somewhat surprised this works... ;)
Assignee: localization → mozeditor
Status: UNCONFIRMED → NEW
Component: Localization → Editor: Core
Ever confirmed: true
QA Contact: amyy → sairuh
Comment 4•21 years ago
|
||
Sorry for spam, but I've given up on being surprised that a segment of code
works. But then, I'm fighting with the Microsoft Win32 API ;-)
Reporter | ||
Comment 5•21 years ago
|
||
Hi,
any progress on this? ;)
I'm tired of seeing a warning for this on windows. I've issued a new cid
because i don't want to rely on 'correcting' the old cid.
Assignee: mozeditor → timeless
Status: NEW → ASSIGNED
Attachment #143728 -
Flags: superreview?(dbaron)
Attachment #143728 -
Flags: review?(brade)
Attachment #143728 -
Flags: approval1.7b?
Updated•21 years ago
|
Attachment #143728 -
Flags: review?(brade) → review+
Comment on attachment 143728 [details] [diff] [review]
new cid
If nobody uses the CID, why do we have it?
(Meaning, why do we bother with an entry in the modules list if nobody ever does
a CreateInstance or a GetService for that CID / contractid (empty contractid).)
Comment on attachment 143728 [details] [diff] [review]
new cid
for lack of answer to my question, marking sr- to get off my review queue
Attachment #143728 -
Flags: superreview?(dbaron) → superreview-
Assignee | ||
Comment 10•21 years ago
|
||
well, the creature eventually leads to an nsIControllerCommandTable, i wonder if
there was an internal customer which had some use for it.
smfr: is there really no need for this cid and the constructor it chains to?
killing the pair would be nice...
Depends on: 201257
Comment 11•21 years ago
|
||
I'd have to spend time looking around to see what the state of things there is,
time which I don't have right now.
Updated•21 years ago
|
Attachment #143728 -
Flags: approval1.7b? → approval1.7?
Comment 12•21 years ago
|
||
Comment on attachment 143728 [details] [diff] [review]
new cid
Can we have a patch that removes this CID and its use at line 154 (remove the
nsModuleComponentInfo array element initializer)?
/be
Assignee | ||
Comment 13•21 years ago
|
||
Comment on attachment 143728 [details] [diff] [review]
new cid
it is used
consider:
Index: nsEditorRegistration.cpp
===================================================================
RCS file: /cvsroot/mozilla/editor/libeditor/build/nsEditorRegistration.cpp,v
retrieving revision 1.34
diff -u0 -r1.34 nsEditorRegistration.cpp
--- nsEditorRegistration.cpp
+++ nsEditorRegistration.cpp
@@ -56,0 +57 @@
+#if 0
@@ -60,0 +62 @@
+#endif
@@ -100 +102 @@
-
+#if 0
@@ -119 +121 @@
-
+#endif
@@ -153 +155 @@
-
+#if 0
@@ -157 +159 @@
-
+#endif
nsEditorRegistration.cpp
/mnt/ibm/mozhack/mozilla/editor/libeditor/build/nsEditorRegistration.cpp: In
function `nsresult nsEditorControllerConstructor(nsISupports *, const nsIID &,
void **)':
/mnt/ibm/mozhack/mozilla/editor/libeditor/build/nsEditorRegistration.cpp:87:
`kEditorCommandTableCID' undeclared (first use this function)
libeditor uses this CID to ensure service semantics and lifetime. It could
bloat itself with startup and shutdown stuff and a static critter which held a
reference, but i don't think that's a good tradeoff.
Attachment #143728 -
Flags: superreview- → superreview?
Assignee | ||
Comment 14•21 years ago
|
||
Comment 15•21 years ago
|
||
@@ -56,0 +57 @@
+#if 0
@@ -60,0 +62 @@
+#endif
@@ -100 +102 @@
-
+#if 0
@@ -119 +121 @@
-
+#endif
@@ -153 +155 @@
-
+#if 0
@@ -157 +159 @@
-
+#endif
diff -u would be a little more useful here, timeless.
Updated•21 years ago
|
Attachment #143728 -
Flags: approval1.7?
Updated•20 years ago
|
Attachment #143728 -
Flags: superreview?
Updated•19 years ago
|
Attachment #143728 -
Flags: superreview?(tor)
Updated•19 years ago
|
Attachment #143728 -
Flags: superreview?(tor) → superreview+
Updated•19 years ago
|
Attachment #143728 -
Flags: approval1.8b3?
Updated•19 years ago
|
Attachment #143728 -
Flags: approval1.8b3? → approval1.8b3+
Assignee | ||
Comment 16•19 years ago
|
||
Comment on attachment 143728 [details] [diff] [review]
new cid
mozilla/editor/libeditor/build/nsEditorRegistration.cpp 1.37
Attachment #143728 -
Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
QA Contact: bugzilla → nobody
Comment 17•19 years ago
|
||
nsComposerRegistration.cpp needs to be fixed, too :)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 18•19 years ago
|
||
Attachment #186541 -
Flags: superreview?(sfraser_bugs)
Attachment #186541 -
Flags: review?(brade)
Updated•19 years ago
|
Attachment #186541 -
Flags: superreview?(sfraser_bugs) → superreview+
Updated•19 years ago
|
Attachment #186541 -
Flags: review?(brade) → review+
Updated•19 years ago
|
Attachment #186541 -
Flags: approval1.8b3?
Updated•19 years ago
|
Attachment #186541 -
Flags: approval1.8b3? → approval1.8b3+
Assignee | ||
Comment 19•19 years ago
|
||
Comment on attachment 186541 [details] [diff] [review]
new CIDs
mozilla/editor/composer/src/nsComposerRegistration.cpp 1.20
mozilla/editor/composer/src/nsComposerRegistration.cpp 1.21
Attachment #186541 -
Attachment is obsolete: true
Comment 20•19 years ago
|
||
fixed now
Status: REOPENED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
QA Contact: nobody → editor
Updated•16 years ago
|
Flags: in-testsuite-
OS: Other → All
Hardware: Other → All
You need to log in
before you can comment on or make changes to this bug.
Description
•