Thread View: gnu.g++.lib.bug
2 messages
2 total messages
Started by T.Day
Thu, 27 Jul 1989 15:50
Need to overload _gsort in e.g Int.Vec.o, Double.Vec.o
Author: T.Day
Date: Thu, 27 Jul 1989 15:50
Date: Thu, 27 Jul 1989 15:50
32 lines
1911 bytes
1911 bytes
From: Tim Day <T.Day@uk.ac.ucl.cs>
I recently put Int.Vec.o and Double.Vec.o into a library
(I prefer Int, Double, Ostream etc to int, double, ostream....
these are all done with typedefs in a common .h file)
However, when I attempted to link with the library from a program
which uses both classes, I had problems with multiple versions
of _gsort.
Int.Vec.cc contains: gsort (Int *, int, IntComparator)
Double.Vec.cc contains: gsort (Double *, int, DoubleComparator)
Since the arguments are all builtin types, I have to put in an
"overload gsort" to force g++ to call the routines
_gsort_PSI_SI_PFSI$SI_SI_
_gsort_PDF_SI_PFSI$DF_DF_
The question is, should the libg++ prototype sources contain overloads to
prevent this sort of thing happening ?
I'm unlikely to want to call routines used internally by libg++ from plain C,
so the argument type info in the function name isn't any kind of problem.
+-----------------------------------------------------------------------------+
Tim Day | Meet every second in life as challenge;
Department of Photogrammetry | Respond fully to whatever happens
UCL, Gower St., London WC1E 6BT | without anxiety, or complaint, or clinging
+-----------------------------------------------------------------------------+
P.S Actually I think the need to overload builtins-only functions is a
hideous asymmetry in the treatment of builtins and classes. C++ syle function
names should be the default unless the function is included within the scope
of an extern "C" {...} or similar, but that's another story....
Need to overload _gsort in e.g Int.Vec.o, Double.Vec.o
Author: Doug Lea
Date: Sat, 29 Jul 1989 11:36
Date: Sat, 29 Jul 1989 11:36
7 lines
699 bytes
699 bytes
See Tiemann's recent bug-g++ note about overload & NO_AUTO_OVERLOAD. In future versions of g++, overloadability will occur by default, which should eliminate such problems. For now, I guess you should manually overload them. -Doug
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads