Christoph Hellwig | 3 Apr 2011 00:09
Favicon

[PATCH] xfs: fix xfs_debug warnings

Err, the subject should have been:

[PATCH] xfs: fix xfs_debug warnings

On Sat, Apr 02, 2011 at 02:13:40PM -0400, Christoph Hellwig wrote:
> For a CONFIG_XFS_DEBUG=n build gcc complains about statements with no
> effect in xfs_debug:
> 
> fs/xfs/quota/xfs_qm_syscalls.c: In function 'xfs_qm_scall_trunc_qfiles':
> fs/xfs/quota/xfs_qm_syscalls.c:291:3: warning: statement with no effect
> 
> The reason for that is that the various new xfs message functions have a
> return value which is never used, and in case of the non-debug build
> xfs_debug the macro evaluates to a plain 0 which produces the above
> warnings.  This can be fixed by turning xfs_debug into an inline function
> instead of a macro, but in addition to that I've also changed all the
> message helpers to return void as we never use their return values.
> 
> Signed-off-by: Christoph Hellwig <hch <at> lst.de>
> 
> Index: linux-2.6/fs/xfs/linux-2.6/xfs_message.c
> ===================================================================
> --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_message.c	2011-04-02 07:29:33.619237021 -0700
> +++ linux-2.6/fs/xfs/linux-2.6/xfs_message.c	2011-04-02 07:33:02.383304718 -0700
>  <at>  <at>  -28,53 +28,47  <at>  <at> 
>  /*
>   * XFS logging functions
>   */
> -static int
> +static void
(Continue reading)

Dave Chinner | 3 Apr 2011 02:16

Re: [PATCH] xfs: fix xfs_debug warnings

On Sat, Apr 02, 2011 at 06:09:05PM -0400, Christoph Hellwig wrote:
> Err, the subject should have been:
> 
> [PATCH] xfs: fix xfs_debug warnings
> 
> On Sat, Apr 02, 2011 at 02:13:40PM -0400, Christoph Hellwig wrote:
> > For a CONFIG_XFS_DEBUG=n build gcc complains about statements with no
> > effect in xfs_debug:
> > 
> > fs/xfs/quota/xfs_qm_syscalls.c: In function 'xfs_qm_scall_trunc_qfiles':
> > fs/xfs/quota/xfs_qm_syscalls.c:291:3: warning: statement with no effect
> > 
> > The reason for that is that the various new xfs message functions have a
> > return value which is never used, and in case of the non-debug build
> > xfs_debug the macro evaluates to a plain 0 which produces the above
> > warnings.  This can be fixed by turning xfs_debug into an inline function
> > instead of a macro, but in addition to that I've also changed all the
> > message helpers to return void as we never use their return values.
> > 
> > Signed-off-by: Christoph Hellwig <hch <at> lst.de>

Looks good, though I don't get those warnings using gcc-4.4.4. I
guess it's gcc-4.6 issuing the warnings?

Reviewed-by: Dave Chinner <dchinner <at> redhat.com>

Cheers,

Dave.
--

-- 
(Continue reading)

Christoph Hellwig | 3 Apr 2011 12:58
Favicon

Re: [PATCH] xfs: fix xfs_debug warnings

On Sun, Apr 03, 2011 at 10:16:48AM +1000, Dave Chinner wrote:
> Looks good, though I don't get those warnings using gcc-4.4.4. I
> guess it's gcc-4.6 issuing the warnings?

Debian testing recently updated to gcc 4.5.2 from gcc 4.4.x, I think
that's when I started to see them.

_______________________________________________
xfs mailing list
xfs <at> oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

Dave Chinner | 4 Apr 2011 02:21

Re: [PATCH] xfs: fix xfs_debug warnings

On Sun, Apr 03, 2011 at 06:58:23AM -0400, Christoph Hellwig wrote:
> On Sun, Apr 03, 2011 at 10:16:48AM +1000, Dave Chinner wrote:
> > Looks good, though I don't get those warnings using gcc-4.4.4. I
> > guess it's gcc-4.6 issuing the warnings?
> 
> Debian testing recently updated to gcc 4.5.2 from gcc 4.4.x, I think
> that's when I started to see them.

Ok, my build box is still running on squeeze which would explain the
difference. I'll look at upgrading it in the not-too-distant future.

Cheers,

Dave.
--

-- 
Dave Chinner
david <at> fromorbit.com

_______________________________________________
xfs mailing list
xfs <at> oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs


Gmane