This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

:? ??


Hi
I have just been fixing several files in KDE 3.0 so they compile using Sun's 
native compiler. The most frequent fix I had to make was the following case:

for some QString a:
QString b = (exp) ? "xyz" : a;

Now the sun compiler insisted the two types in ?: needs to be identical. Now 
I am wondering what on earth gcc is doing?
Is it doing: 
  (exp) ? QString("xyz") : a
or
  QString(exp ? "xyz" : (const char*)a);

in the case of QString it doesnt matter because it is reversable, but this is 
not always be the case! Shouldnt gcc atleast give a warning before doing an 
ambigous type-cast?

greetings
`Allan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]