From: "Jan Beulich" Subject: Re: xen/x86: unable to build with gcc5 Date: Fri, 13 Mar 2015 12:58:45 +0000 Message-ID: <5502ED150200007800069C8E@mail.emea.novell.com> References: <1426248035.32572.125.camel@citrix.com> <5502E1AC0200007800069C31@mail.emea.novell.com> <1426249526.32572.130.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426249526.32572.130.camel@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Keir Fraser , xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 13.03.15 at 13:25, wrote: > From: Ian Campbell > Date: Fri, 13 Mar 2015 12:22:25 +0000 > Subject: [PATCH] xen: common: Use unbounded array for symbols_offset. > > Using a singleton array causes gcc5 to report: > symbols.c: In function 'symbols_lookup': > symbols.c:128:359: error: array subscript is above array bounds > [-Werror=array-bounds] > symbols.c:136:176: error: array subscript is above array bounds > [-Werror=array-bounds] > > Signed-off-by: Ian Campbell Acked-by: Jan Beulich > --- > xen/common/symbols.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/common/symbols.c b/xen/common/symbols.c > index bc2fde6..fc7c9e7 100644 > --- a/xen/common/symbols.c > +++ b/xen/common/symbols.c > @@ -19,7 +19,7 @@ > #include > > #ifdef SYMBOLS_ORIGIN > -extern const unsigned int symbols_offsets[1]; > +extern const unsigned int symbols_offsets[]; > #define symbols_address(n) (SYMBOLS_ORIGIN + symbols_offsets[n]) > #else > extern const unsigned long symbols_addresses[]; > -- > 2.1.4