qt6-bb10/tests/auto/corelib
Marc Mutz 42c467a11d Add __attribute__((format(printf()))) to q(v)nprintf()
They were lacking it since the start of the public history, and
porting to std::snprintf() (which has the warning) as part of making
Qt compile with QT_NO_SNPRINTF has turned up surprisingly many
-Wformat warnings, so enable the warning for the remaining (non-tree)
users.

Backporting aggressively, as this might unearth security bugs in user
code.

[ChangeLog][QtCore][q(v)snprintf] Added attributes for GCC-compatible
compilers to detect format/argument mismatches. If this throws warnings
for your calls now, don't ignore them. printf() format mistakes could
be security-relevant. You may also find that you relied on undocumented
behavior, such as that certain implementations (Windows, Android, WASM)
of qsnprintf() support char16_t* instead of wchar_t* for %ls. In that
case, you should port to qUtf16Printable() and QString::asprintf(), or
suppress the warning and port away from the platform dependence at your
earliest convenience.

Task-number: QTBUG-127110
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I5c1fd9b2d5d2d55c68773f33edfd76acacd2408c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit 64416d3cf645187385d8ad90bc44d9c8e9ce864f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 07:47:19 +00:00
..
animation Change license for tests files 2024-02-04 09:56:42 +01:00
global QKeyCombination: move the operators into namespace Qt 2024-07-31 15:21:36 +00:00
io Call std::addressof instead of operator& in QDebug::toString 2024-07-25 11:21:35 +00:00
ipc ipctestcommon.h: port away from qsnprintf() 2024-07-30 16:47:32 +00:00
itemmodels [doc] Q(Persistent)ModelIndex: document behavior of data() on invalid Q(P)MIs 2024-07-06 10:17:53 +00:00
kernel tst_QDeadlineTimer: fix format-string in toString() implementation 2024-07-22 21:00:13 +00:00
mimetypes tst_QMimeDatabase: update shared-mime-info local testing instructions 2024-07-23 22:52:53 +00:00
platform Rename target of the BSTR test in QtCore to avoid conflict 2024-07-09 14:10:16 +00:00
plugin QLibrary/Unix: update the x86-64-v3 prefix path in our search 2024-07-11 08:27:24 +00:00
serialization Tests: disable various compiler warnings 2024-07-12 00:48:40 +00:00
text Add __attribute__((format(printf()))) to q(v)nprintf() 2024-08-03 07:47:19 +00:00
thread QThread/Unix: fix normal exit/terminate() race 2024-07-11 08:27:17 +00:00
time Update CLDR Windows timezone data to v44.1 2024-06-02 15:25:00 +02:00
tools QArrayDataOps: fix FP equality comparison 2024-07-26 11:22:32 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00