The compiler is worried about you possibly storing that pointer to a date which in that context is a temporary. You aren't but the correct way to fix this in C++ is to pass date as a const reference parameter. You get the speed of a pointer, but much safer code.
On 6/1/12 2:40 PM Robert Wood wrote: Adding QMAKE_CXXFLAGS=-fpermissive in additional arguments in the projects tab does the trick. I'd like to know why there is the change and how to fix it properly though. An example of a rogue lines is this: queryString += "\"" + sqlFormatString(&ui->dateInDateEdit->date()) + "\","; The routine is defined as follows: QString enter_invoice_in::sqlFormatString(QDate *date); So, I'm passing a pointer to a date which is on a form. Thanks again. On 01/06/12 17:53, Konstantin Tokarev wrote: > > > 01.06.2012, 20:11, "Robert Wood"<robert.w...@apostrophe.co.uk>: >> Folks, >> >> I have just upgraded to Mageia Linux 2 and am now getting this compile >> error: >> >> error: taking address of temporary [-fpermissive] >> >> This was previously compiling just fine. >> >> I'm now running Creator 2.4.1 Based on Qt 4.8.0. >> >> Anyone know what is going on please? > > BTW compiler proposes you to add -fpermissive to flags to get this code > accepted as it was before. > _______________________________________________ Interest mailing list robert.w...@apostrophe.co.uk http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest