[Qt-interest] Qt code compiles fine on mscv9.0 but failed with gcc

Bruno Colombet Bruno.Colombet at univmed.fr
Wed Jan 26 12:12:58 CET 2011


Le 25/01/2011 18:02, Tim Dewhirst a écrit :
> Hello,
>
> On 25/01/2011 16:18, Bo Thorsen wrote:
>> Den 25-01-2011 16:51, jjDaNiMoTh skrev:
>>> 2011/1/25 Bob Hood<bhood2 at comcast.net>:
>>>> On 1/25/2011 6:24 AM, Bruno Colombet wrote:
>>>>> a call like this :  addCustomChannel(chan)  compiles in MSCV
>>>>> but gcc complains: error: default argument parameter of type 'QString&' has
>>>>> type 'QString'
>>>>>
>>>> Yeah, welcome to the nightmare of modern cross compiling.  :)
>> I completely disagree with that (and it's multi compiler, not cross
>> compiler). The more time you spend on multiple compilers, the cleaner
>> C++ you write.
> I completely agree with that; I've lost count of the number of times
> we've gone to work on someone's codebase to discover they've been using
> e.g. msvc9 exclusively with loads of warnings turned off, and then
> wonder why their code won't compile first time with a different
> compiler/platform/...
>
> Tim
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
You're right Tim but I was assuming msvc compiler was doing the 
correction automaticaly and I think that is actually what it does. Gcc 
doesn't and then came the pb.
Even with no warnings about const reference type, msvc produced a code 
that is fully functionnal and stable.

I agree anyway that we must pay attention to stay in the correct 
programming way of C++.

-- 
Bruno Colombet
*INSERM UMR 751* - Epilepsie et Cognition
Faculté de Médecine
27 Bd Jean Moulin
13385 Marseille cedex 05
+33 4 91 38 55 40
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110126/4a4612ae/attachment.html 


More information about the Qt-interest-old mailing list