From: Danny Kukawka <hidden> Date: 2012-01-30 22:00:43
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1], define structs[1] as
structs[4].
Signed-off-by: Danny Kukawka <redacted>
---
drivers/isdn/hardware/eicon/capi20.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
From: Ben Hutchings <hidden> Date: 2012-01-30 23:09:37
On Mon, 2012-01-30 at 23:00 +0100, Danny Kukawka wrote:
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1], define structs[1] as
structs[4].
I suspect that all the 'byte structs[1];' fields defined in that header
are actually variable-length arrays. In that case, there may be no
reasonable bound you can specify.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
On Mon, Jan 30, 2012 at 11:09:32PM +0000, Ben Hutchings wrote:
On Mon, 2012-01-30 at 23:00 +0100, Danny Kukawka wrote:
quoted
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1], define structs[1] as
structs[4].
I suspect that all the 'byte structs[1];' fields defined in that header
are actually variable-length arrays. In that case, there may be no
reasonable bound you can specify.
Yes, exactely, the structs is a ASN1 coded message so it can have any len.
Karsten
From: Danny Kukawka <hidden> Date: 2012-01-31 17:05:09
On Dienstag, 31. Januar 2012, Karsten Keil wrote:
On Mon, Jan 30, 2012 at 11:09:32PM +0000, Ben Hutchings wrote:
quoted
On Mon, 2012-01-30 at 23:00 +0100, Danny Kukawka wrote:
quoted
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1], define structs[1] as
structs[4].
I suspect that all the 'byte structs[1];' fields defined in that header
are actually variable-length arrays. In that case, there may be no
reasonable bound you can specify.
Yes, exactely, the structs is a ASN1 coded message so it can have any len.
So, how can we get rid of the compiler warning then?
Danny
From: David Laight <hidden> Date: 2012-02-01 09:05:15
-----Original Message-----
From: netdev-owner@vger.kernel.org
[mailto:netdev-owner@vger.kernel.org] On Behalf Of Danny Kukawka
Sent: 31 January 2012 17:04
To: Karsten Keil
Cc: Ben Hutchings; Armin Schindler;
linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Karsten Keil
Subject: Re: [PATCH 01/16] eicon: fix -Warray-bounds warning
On Dienstag, 31. Januar 2012, Karsten Keil wrote:
quoted
On Mon, Jan 30, 2012 at 11:09:32PM +0000, Ben Hutchings wrote:
quoted
On Mon, 2012-01-30 at 23:00 +0100, Danny Kukawka wrote:
quoted
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1], define structs[1] as
structs[4].
I suspect that all the 'byte structs[1];' fields defined
in that header
quoted
quoted
are actually variable-length arrays. In that case, there
may be no
quoted
quoted
reasonable bound you can specify.
Yes, exactely, the structs is a ASN1 coded message so it
can have any len.
So, how can we get rid of the compiler warning then?
Try defining it as a 'variable sized array' - byte structs[0].
David
From: Danny Kukawka <hidden> Date: 2012-02-01 12:53:09
On Mittwoch, 1. Februar 2012, David Laight wrote:
quoted
-----Original Message-----
From: netdev-owner@vger.kernel.org
[mailto:netdev-owner@vger.kernel.org] On Behalf Of Danny Kukawka
Sent: 31 January 2012 17:04
To: Karsten Keil
Cc: Ben Hutchings; Armin Schindler;
linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Karsten Keil
Subject: Re: [PATCH 01/16] eicon: fix -Warray-bounds warning
On Dienstag, 31. Januar 2012, Karsten Keil wrote:
quoted
On Mon, Jan 30, 2012 at 11:09:32PM +0000, Ben Hutchings wrote:
quoted
On Mon, 2012-01-30 at 23:00 +0100, Danny Kukawka wrote:
quoted
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1], define structs[1] as
structs[4].
I suspect that all the 'byte structs[1];' fields defined
in that header
quoted
quoted
are actually variable-length arrays. In that case, there
may be no
quoted
quoted
reasonable bound you can specify.
Yes, exactely, the structs is a ASN1 coded message so it
can have any len.
So, how can we get rid of the compiler warning then?
Try defining it as a 'variable sized array' - byte structs[0].
Okay, that works. I'll send an updated patch.
Thanks
Danny
On Wed, Feb 01, 2012 at 01:52:18PM +0100, Danny Kukawka wrote:
On Mittwoch, 1. Februar 2012, David Laight wrote:
quoted
quoted
-----Original Message-----
From: netdev-owner@vger.kernel.org
[mailto:netdev-owner@vger.kernel.org] On Behalf Of Danny Kukawka
Sent: 31 January 2012 17:04
To: Karsten Keil
Cc: Ben Hutchings; Armin Schindler;
linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Karsten Keil
Subject: Re: [PATCH 01/16] eicon: fix -Warray-bounds warning
On Dienstag, 31. Januar 2012, Karsten Keil wrote:
quoted
On Mon, Jan 30, 2012 at 11:09:32PM +0000, Ben Hutchings wrote:
quoted
On Mon, 2012-01-30 at 23:00 +0100, Danny Kukawka wrote:
quoted
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1], define structs[1] as
structs[4].
I suspect that all the 'byte structs[1];' fields defined
in that header
quoted
quoted
are actually variable-length arrays. In that case, there
may be no
quoted
quoted
reasonable bound you can specify.
Yes, exactely, the structs is a ASN1 coded message so it
can have any len.
So, how can we get rid of the compiler warning then?
Try defining it as a 'variable sized array' - byte structs[0].