Closed
Bug 69289
Opened 24 years ago
Closed 24 years ago
|Substring| doesn't compile on gcc 2.7.2.3
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla0.9
People
(Reporter: dbaron, Assigned: scc)
References
Details
The |Substring| function (defined as an overloaded pair of function templates in
nsAReadableString.h) doesn't compile on gcc 2.7.2.3 if the first argument needs
a conversion to get to |basic_nsAReadableString<charT>&|. This causes bustage
and has been fixed in the tree both with NS_READABLE_CAST and with direct
construction of an nsPromiseSubstring<charT>. It gives the error:
/builds/seamonkey/mozilla/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp:139:
type unification failed for function template `template <class CharT>
nsPromiseSubstring<...> Substring(basic_nsAReadableString<...> &, unsigned int,
unsigned int)'
If I comment out the first of the two overloaded function templates, it gives
the error:
/builds/seamonkey/mozilla/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp:139:
type unification failed for function template `template <class CharT>
nsPromiseSubstring<...> Substring(basic_nsAReadableString<...> &,
nsReadingIterator<...> &, nsReadingIterator<...> &)'
If I change nsAReadableString.h to un-templatize the function (i.e., just
provide 2 versions of each, one for charT == char and one for charT ==
PRUnichar), it compiles without NS_READABLE_CAST.
Perhaps we should do this to avoid bustage, perhaps based on some autoconf test
(although I don't think it would do any harm for other platforms...)?
Reporter | ||
Comment 1•24 years ago
|
||
Scratch that un-templatizing suggestion -- it didn't link, at least not with gcc
2.96 (RH).
Reporter | ||
Comment 2•24 years ago
|
||
Oops! The linker errors were because I forgot to declare the functions |inline|.
Assignee | ||
Comment 3•24 years ago
|
||
OK, the un-templatizing scheme sounds like the right thing to do then.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Assignee | ||
Comment 4•24 years ago
|
||
See patch in bug #69940.
Comment 5•24 years ago
|
||
[r|sr]=waterson, pick one.
Assignee | ||
Comment 6•24 years ago
|
||
patch (from bug #69940) checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•