summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-07-29 20:10:50 +0200
committerMarc Mutz <marc.mutz@qt.io>2024-08-03 05:10:00 +0000
commit64416d3cf645187385d8ad90bc44d9c8e9ce864f (patch)
treef3d9c2fbae21514b75a888cf386419fb811a6fee /src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp
parent57eff5b092dbd692594125edc70d3efd898660ea (diff)
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.8 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>
Diffstat (limited to 'src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp')
0 files changed, 0 insertions, 0 deletions