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