From: David Laight <David.Laight@ACULAB.COM>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
Imre Deak <imre.deak@intel.com>
Subject: Build fail in drivers/gpu/drm/i915/display/intel_tc.c
Date: Thu, 9 Nov 2023 22:55:38 +0000 [thread overview]
Message-ID: <4df68c74c4da46ac943ac21578e9b084@AcuMS.aculab.com> (raw)
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)
next reply other threads:[~2023-11-09 22:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 22:55 David Laight [this message]
2023-11-09 23:34 ` Build fail in drivers/gpu/drm/i915/display/intel_tc.c Imre Deak
2023-11-10 0:51 ` Linus Torvalds
2023-11-10 9:00 ` David Laight
2023-11-14 19:07 ` Imre Deak
2023-11-15 9:26 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4df68c74c4da46ac943ac21578e9b084@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=imre.deak@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox