Closed Bug 15773 Opened 25 years ago Closed 25 years ago

Compilation error with some gcc versions

Categories

(Core :: Internationalization, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: drepper, Assigned: cata)

Details

(Whiteboard: Waiting for further informations from the reporter.)

Some gcc versions (I'm using the current development version of gcc) have a bug when it comes to static variables in C++ functions which have an extern "C" struct type. gcc errorneously emits a name without a special prefix to distinguish the variable. In the case where in the same source file there are two static variable definitions with the same name the assembler will complain about multiple definitions of the same symbol. This will be fixed in upcoming gcc releases but might be present in currently used versions. Therefore I propose a patch like the one below. Feel free to change the name to whatever you think is appropriate. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Index: intl/uconv/ucvja/nsUCvJaSupport.cpp =================================================================== RCS file: /cvsroot/mozilla/intl/uconv/ucvja/nsUCvJaSupport.cpp,v retrieving revision 1.8 diff -u -u -r1.8 nsUCvJaSupport.cpp --- nsUCvJaSupport.cpp 1999/09/10 19:03:14 1.8 +++ nsUCvJaSupport.cpp 1999/10/07 20:14:54 @@ -363,7 +363,7 @@ *aInstancePtr = NULL; - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + static NS_DEFINE_IID(kISupportsIID2, NS_ISUPPORTS_IID); if (aIID.Equals(kIUnicodeEncoderIID)) { *aInstancePtr = (void*) ((nsIUnicodeEncoder*)this); @@ -375,7 +375,7 @@ NS_ADDREF_THIS(); return NS_OK; } - if (aIID.Equals(kISupportsIID)) { + if (aIID.Equals(kISupportsIID2)) { *aInstancePtr = (void*) ((nsISupports*)((nsIUnicodeEncoder*)this)); NS_ADDREF_THIS(); return NS_OK; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It's a low risk patch since it's completely local.
Assignee: ftang → cata
cata , can you take care this for me ?
Status: NEW → ASSIGNED
Target Milestone: M12
Target Milestone: M12 → M13
Whiteboard: Waiting for further informations from the reporter.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Checked in the patch. Thanks, Ulrich!
QA Contact: teruko → cata
You need to log in before you can comment on or make changes to this bug.