lkml.org 
[lkml]   [2023]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectBuild fail in drivers/gpu/drm/i915/display/intel_tc.c
Date
I'm seeing a build fail at line 1878 of intel_tc.c

gcc is being a bit over-enthusiastic about snprintf() formats
and reports that "%c/TC#%d", xxx, tc_port + 1 might not fit
in the 8 bytes available.
'tc_port' is an enum with values -1 to 5.
I guess it is either allowing for the full 'int' value of
the enum.
Changing to '(tc_port & 7) + 1' stops the compiler bleating.

The code isn't new, so I guess the compiler flags have changed?

It might depend on the gcc version as well.
I'm using gcc 7.5.0 from Ubuntu 18.04.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2023-11-20 13:54    [W:0.114 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site