It's not like I don't understand all that. But I am not that person who
introduced the regression and

a) He doesn't use a compiler that supports this warning
b) ... and he wouldn't have read it in the first place. (unfortunately)
c) He doesn't much care about docs

Not saying it's correct, just stating the fact that function name is
confusing and potentially problematic because it doesn't do what it states
it does.

On Thu, Dec 13, 2018 at 5:16 PM Sérgio Martins <[email protected]>
wrote:

> On 2018-12-13 13:48, NIkolai Marchenko wrote:
> > This non obvious (from function name) behaviour actually caused
> > infinite
> > loop regression in our code just recently.
> > The person used it inside a while loop thinking it will loop upwards
> > and
> > stop.
>
>
> If your compiler supports it, you should get a warning such as:
>
> warning: ignoring return value of ‘QDateTime QDateTime::addDays(qint64)
> const’, declared with attribute nodiscard [-Wunused-result]
>
> Also useful for many other Qt classes.
>
>
> Regards,
> --
> Sérgio Martins | [email protected] | Senior Software Engineer
> Klarälvdalens Datakonsult AB, a KDAB Group company
> Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
> KDAB - The Qt, C++ and OpenGL Experts
>
_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to