From d6309eb605b6ebfe6b5be34e5b877d2112584dcf Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 14 Mar 2023 11:11:49 +0200 Subject: [PATCH] Fix -Wformat QVector::count()'s return type is qsizetype. On a 64 bit platform, it's equivalent to qint64, so "%d" does not suffice. There are two ways to fix it: use PRIdQSIZETYPE or switch to the stream operator. Since the warning format is not complex, this takes the latter approach. --- src/backends/drm/drm_gpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/drm/drm_gpu.cpp b/src/backends/drm/drm_gpu.cpp index 79a73fcc33..01bd23a2b0 100644 --- a/src/backends/drm/drm_gpu.cpp +++ b/src/backends/drm/drm_gpu.cpp @@ -622,13 +622,13 @@ std::unique_ptr DrmGpu::leaseOutputs(const QVector &outpu FileDescriptor fd{drmModeCreateLease(m_fd, objects.constData(), objects.count(), 0, &lesseeId)}; if (!fd.isValid()) { qCWarning(KWIN_DRM) << "Could not create DRM lease!" << strerror(errno); - qCWarning(KWIN_DRM, "Tried to lease the following %d resources:", objects.count()); + qCWarning(KWIN_DRM) << "Tried to lease the following" << objects.count() << "resources:"; for (const auto &res : std::as_const(objects)) { qCWarning(KWIN_DRM) << res; } return nullptr; } else { - qCDebug(KWIN_DRM, "Created lease for %d resources:", objects.count()); + qCDebug(KWIN_DRM) << "Created lease for" << objects.count() << "resources:"; for (const auto &res : std::as_const(objects)) { qCDebug(KWIN_DRM) << res; }