[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD008227C@AcuExch.aculab.com>
Date: Wed, 27 Sep 2017 09:04:35 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Felix Manlunas' <felix.manlunas@...ium.com>,
"davem@...emloft.net" <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"raghu.vatsavayi@...ium.com" <raghu.vatsavayi@...ium.com>,
"derek.chickles@...ium.com" <derek.chickles@...ium.com>,
"satananda.burla@...ium.com" <satananda.burla@...ium.com>
Subject: RE: [PATCH net-next] liquidio: fix format truncation warning
reported by gcc 7.1.1
From: Felix Manlunas
> Sent: 26 September 2017 19:48
> gcc 7.1.1 with -Wformat-truncation reports these warnings:
>
> drivers/net/ethernet/cavium/liquidio/lio_core.c: In function `octeon_setup_interrupt':
> drivers/net/ethernet/cavium/liquidio/lio_core.c:1003:41: warning: `%u' directive output may be
> truncated writing between 1 and 10 bytes into a region of size between 0 and 13 [-Wformat-truncation=]
> INTRNAMSIZ, "LiquidIO%u-pf%u-rxtx-%u",
...
> Fix them by changing the type of the "i" local variable from int to short.
That probably adds pointless code bloat by forcing the compiler to
keep masking the value with 0xffff after every arithmetic operation.
About the only architecture that doesn't suffer the penalty is x86.
Until the compiler can correctly track the domain of values (and
be given hints about the domains) this warning is, IMHO, OTT.
David
Powered by blists - more mailing lists