Mail Archives: djgpp/1997/12/24/13:20:08
Hey - I'm not yet on this list, but I found what might be a bug in
DJGPP gcc and had no luck whatsoever posting it on the Delorie web
site. So here's a repeat:
----------------------------------------------------------------------
I discovered this error while compiling a reasonably large (9600 line)
C++ program with gcc:
Assembler messages:
48154: Fatal error: Symbol _sort__FPiT0PFii_b already defined.
I can't print the entire source right here, but the gist is that I am
using the STL sort algorithm on vectors with an alternate Compare
function. In fact, I'm using it more than once with two different
Compare functions, both of which are static member functions of
different classes.
An *very* brief example:
vector<int> aVector, bVector;
// ...
sort(aVector.begin(), aVector.end(), cClass1::NewLess);
sort(bVector.begin(), bVector.end(), cClass2::OtherLess);
// where:
// bool cClass1::NewLess(int i, int j) { ... }
// bool cClass2::OtherLess(int i, int j) { ... }
There are no compilation errors (the only warnings are signed/unsigned
comparisons), just the as fatal. I compiled -S to view the assembler
source, and discovered that the two instances of _sort__FPiT0PFii_b are
identical except for a single label. For some reason the compiler is
emitting two copies.
I wrote a much smaller sample to duplicate the error, and it compiled
perfectly. I'll keep working to find an uncluttered example to
reproduce the bug, but until I find it, maybe this will prompt
someone's light bulb.
----------------------------------------------------------------------
John Mayer
- Raw text -