From a47a5932a64a8867077cab7c8efa57587b637481 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Wed, 21 Sep 2022 10:17:06 +0200 Subject: [PATCH] Mention in qRound*() docs about possibe UB Change-Id: I0fcb9a72993959d028df1a9ef719938b1c555a2d Reviewed-by: Thiago Macieira --- src/corelib/global/qnumeric.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/corelib/global/qnumeric.cpp b/src/corelib/global/qnumeric.cpp index b846325964..16b2b7ca40 100644 --- a/src/corelib/global/qnumeric.cpp +++ b/src/corelib/global/qnumeric.cpp @@ -351,6 +351,9 @@ Q_CORE_EXPORT quint64 qFloatDistance(double a, double b) Example: \snippet code/src_corelib_global_qglobal.cpp 11A + + \note If the value \a d is outside the range of \c int, + the behavior is undefined. */ /*! \fn int qRound(float d) @@ -365,6 +368,9 @@ Q_CORE_EXPORT quint64 qFloatDistance(double a, double b) Example: \snippet code/src_corelib_global_qglobal.cpp 11B + + \note If the value \a d is outside the range of \c int, + the behavior is undefined. */ /*! \fn qint64 qRound64(double d) @@ -379,6 +385,9 @@ Q_CORE_EXPORT quint64 qFloatDistance(double a, double b) Example: \snippet code/src_corelib_global_qglobal.cpp 12A + + \note If the value \a d is outside the range of \c qint64, + the behavior is undefined. */ /*! \fn qint64 qRound64(float d) @@ -393,6 +402,9 @@ Q_CORE_EXPORT quint64 qFloatDistance(double a, double b) Example: \snippet code/src_corelib_global_qglobal.cpp 12B + + \note If the value \a d is outside the range of \c qint64, + the behavior is undefined. */ /*!