xfs
[Top] [All Lists]

Re: [PATCH 2/2] xfs: rearrange xfs_mod_sb() to avoid array subscript war

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/2] xfs: rearrange xfs_mod_sb() to avoid array subscript warning
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 19 Jan 2010 04:23:20 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1263861711-13900-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1263861711-13900-1-git-send-email-david@xxxxxxxxxxxxx> <1263861711-13900-3-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Tue, Jan 19, 2010 at 11:41:51AM +1100, Dave Chinner wrote:
> gcc warns of an array subscript out of bounds in xfs_mod_sb().
> The code is written in such a way that if the array subscript is
> out of bounds, then it will assert fail. Rearrange the code to
> avoid the bounds check warning.

Does it avoid the warning also for non-debug builds where the assert
goes away?  Anyway, the reordering is correct, so:


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

<Prev in Thread] Current Thread [Next in Thread>