Problem with redundant typedefs (ref KDE and qt-1.33)

colin@field.medicine.adelaide.edu.au colin@field.medicine.adelaide.edu.au
Sun May 3 06:58:00 GMT 1998


Here's a problem in egcs-2.91.26 19980502 (gcc2 ss-980401 experimental) which 
contributes to the difficulty compiling KDE and qt-1.33

The redundant typedef causes a different prototype to be emitted.  This causes 
problems when you're compiling code into a library and then trying to access 
the method from elsewhere, as the two prototypes may not match (if there are 
redundant typedefs.)

This problem crops up in qt-1.33's qstring.

test.cpp:

typedef unsigned int uint;

#ifdef BREAKIT
typedef unsigned int uint;
#endif

int mid(uint a, uint b)
{
}

---
/user/home/colin/comptest$ g++ -c test.cpp; nm test.o | grep mid
00000000 T mid__FUiT0
/user/home/colin/comptest$ g++ -DBREAKIT -c test.cpp; nm test.o | grep mid
00000000 T mid__FUiUi
---




More information about the Gcc-bugs mailing list