[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#564274: g++-4.4: Program is compiling by g++, even there is a bad conversion



tags 564274 + moreinfo
thanks

On Fri, Jan 08, 2010 at 10:40:07PM +0100, S??awomir Domaga??a wrote:
> I can't make shorter source code, where is this error, thus I've got all source code from my programme, but I've written which lines is the error.
> 
> Line from 156 to 161 in engine.cpp:
> 
> SingleWord sword;
> //definition class SingleWord is in file "SingleWord.h"
> for(ushort i = 0; i < number_words; i++) {
>       atime = time(NULL);
>       sword = courses[activ_course]->getSingleWord(swords[i]);
> 	//courses is vector<Kurs>, definition class Kurs in file "kurs.hpp"
>       sword.setSpelling("cat");
> 
> But definition function getSingleWord(swords[i]) is:
> SingleWord const* Kurs::getSingleWord(ushort number) const
> {
>         if(number >= qAllSingleWords)throw Error::newError(Error::BAD_ARGUMENT, "", __LINE__, __FILE__);
>         return number < wordl1.size() ? wordl1[number] : wordl2[number-wordl1.size()];
> }
> 
> The source code is compiling with no errors: "g++-4.4 -pedantic main.cpp engine.cpp nakladka2.cpp kurs.cpp SingleWord.cpp RegisterOfErrors.cpp -lboost_regex-mt -o main.e"

Please be more specific where you see a problem here. SingleWord has a
constructor which takes SingleWord const*, which will be invoked in
the assignment.

  Falk



Reply to: