This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
:? ??
- From: Allan Sandfeld Jensen <snowwolf at one2one-networks dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 19 Mar 2002 17:09:33 +0100
- Subject: :? ??
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