Jani Nikula
2024-May-23  15:51 UTC
[PATCH 4/4] drm: enable -Wformat-truncation across the subsystem
With the -Wformat-truncation warnings fixed, finish the job started in
commit a61ddb4393ad ("drm: enable (most) W=1 warnings by default across
the subsystem"), and enable that warning too.
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
Gut feeling says there are more issues, and my configs just don't catch
them all, but let's see what the build bots have to say. ;)
---
 drivers/gpu/drm/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 68cc9258ffc4..644613dbedda 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -16,8 +16,7 @@ subdir-ccflags-y += $(call cc-option,
-Wunused-but-set-variable)
 subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
 subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
 subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
-# FIXME: fix -Wformat-truncation warnings and uncomment
-#subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
+subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
 subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
 # The following turn off the warnings enabled by -Wextra
 ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
-- 
2.39.2
Sam Ravnborg
2024-May-23  18:41 UTC
[PATCH 4/4] drm: enable -Wformat-truncation across the subsystem
Hi Jani, On Thu, May 23, 2024 at 06:51:09PM +0300, Jani Nikula wrote:> With the -Wformat-truncation warnings fixed, finish the job started in > commit a61ddb4393ad ("drm: enable (most) W=1 warnings by default across > the subsystem"), and enable that warning too. > > Signed-off-by: Jani Nikula <jani.nikula at intel.com>When it is enabled for all of drm then the explicit assignments here could be dropped I think: drivers/gpu/drm/i915/Makefile:subdir-ccflags-y += $(call cc-option, -Wformat-truncation) drivers/gpu/drm/xe/Makefile:subdir-ccflags-y += $(call cc-option, -Wformat-truncation) Just a drive-by comment, I know this patch was mostly for the bots. Sam> > --- > > Gut feeling says there are more issues, and my configs just don't catch > them all, but let's see what the build bots have to say. ;) > --- > drivers/gpu/drm/Makefile | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile > index 68cc9258ffc4..644613dbedda 100644 > --- a/drivers/gpu/drm/Makefile > +++ b/drivers/gpu/drm/Makefile > @@ -16,8 +16,7 @@ subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable) > subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) > subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) > subdir-ccflags-y += $(call cc-option, -Wformat-overflow) > -# FIXME: fix -Wformat-truncation warnings and uncomment > -#subdir-ccflags-y += $(call cc-option, -Wformat-truncation) > +subdir-ccflags-y += $(call cc-option, -Wformat-truncation) > subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) > # The following turn off the warnings enabled by -Wextra > ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) > -- > 2.39.2
Apparently Analagous Threads
- [PATCH 4/4] drm: enable -Wformat-truncation across the subsystem
- [PATCH 0/4] drm: enable -Wformat-truncation
- [PATCH (set 1) 00/20] Rid W=1 warnings from GPU
- [PATCH (set 1) 00/20] Rid W=1 warnings from GPU
- [PATCH 3/4] drm/imx: fix -Wformat-truncation warning in imx_ldb_probe()