Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756062Ab2BAJFP (ORCPT ); Wed, 1 Feb 2012 04:05:15 -0500 Received: from mx0.aculab.com ([213.249.233.131]:51470 "HELO mx0.aculab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753980Ab2BAJFI convert rfc822-to-8bit (ORCPT ); Wed, 1 Feb 2012 04:05:08 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Subject: RE: [PATCH 01/16] eicon: fix -Warray-bounds warning Date: Wed, 1 Feb 2012 09:04:48 -0000 Message-ID: In-Reply-To: <201201311804.20464.danny.kukawka@bisect.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 01/16] eicon: fix -Warray-bounds warning Thread-Index: AczgOnoxHay8jt8aR1u7f+Xf/9MGbAAhfbeA From: "David Laight" To: "Danny Kukawka" , "Karsten Keil" Cc: "Ben Hutchings" , "Armin Schindler" , , , "Karsten Keil" X-OriginalArrivalTime: 01 Feb 2012 09:04:48.0732 (UTC) FILETIME=[8CCA69C0:01CCE0C0] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1441 Lines: 40 > -----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: > > 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: > > > > 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? Try defining it as a 'variable sized array' - byte structs[0]. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/