2010-01-25 04:05:10

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: vfs/fsnotify trees build warning

Hi Eric, Al,

Today's linux-next build (x86_64 allmodconfig) produced these warnings:

In file included from include/linux/security.h:26,
from fs/xfs/linux-2.6/xfs_iops.c:56:
include/linux/fsnotify.h: In function 'fsnotify_move':
include/linux/fsnotify.h:87: warning: pointer targets in initialization differ in signedness
include/linux/fsnotify.h: In function 'fsnotify_create':
include/linux/fsnotify.h:154: warning: pointer targets in passing argument 5 of 'fsnotify' differ in signedness
include/linux/fsnotify_backend.h:300: note: expected 'const char *' but argument is of type 'const unsigned char *'
include/linux/fsnotify.h: In function 'fsnotify_link':
include/linux/fsnotify.h:167: warning: pointer targets in passing argument 5 of 'fsnotify' differ in signedness
include/linux/fsnotify_backend.h:300: note: expected 'const char *' but argument is of type 'const unsigned char *'
include/linux/fsnotify.h: In function 'fsnotify_mkdir':
include/linux/fsnotify.h:180: warning: pointer targets in passing argument 5 of 'fsnotify' differ in signedness
include/linux/fsnotify_backend.h:300: note: expected 'const char *' but argument is of type 'const unsigned char *'

I am not sure why these started turning up (they were there on Friday as
well and I may have missed them earlier).
--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (1.38 kB)
(No filename) (198.00 B)
Download all attachments

2010-01-25 04:16:26

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: vfs/fsnotify trees build warning

Hi Eric, Al,

On Mon, 25 Jan 2010 15:04:56 +1100 Stephen Rothwell <[email protected]> wrote:
>
> Today's linux-next build (x86_64 allmodconfig) produced these warnings:

These warnings only appear after I merge the fsnotify tree into
linux-next. The vfs tree has been merged much earlier. So at least the
first of these is introduced by a vfs tree commit
(82a1dff3ed894a3b453474f168d55381a1e7318c "Lose the new_name argument of
fsnotify_move()") but only exposed by the merge of the fsnotify tree.

> In file included from include/linux/security.h:26,
> from fs/xfs/linux-2.6/xfs_iops.c:56:
> include/linux/fsnotify.h: In function 'fsnotify_move':
> include/linux/fsnotify.h:87: warning: pointer targets in initialization differ in signedness

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (869.00 B)
(No filename) (198.00 B)
Download all attachments

2010-01-25 04:29:35

by Dave Chinner

[permalink] [raw]
Subject: Re: linux-next: vfs/fsnotify trees build warning

On Mon, Jan 25, 2010 at 03:04:56PM +1100, Stephen Rothwell wrote:
> Hi Eric, Al,
>
> Today's linux-next build (x86_64 allmodconfig) produced these warnings:
>
> In file included from include/linux/security.h:26,
> from fs/xfs/linux-2.6/xfs_iops.c:56:
> include/linux/fsnotify.h: In function 'fsnotify_move':
> include/linux/fsnotify.h:87: warning: pointer targets in initialization differ in signedness
> include/linux/fsnotify.h: In function 'fsnotify_create':
> include/linux/fsnotify.h:154: warning: pointer targets in passing argument 5 of 'fsnotify' differ in signedness
> include/linux/fsnotify_backend.h:300: note: expected 'const char *' but argument is of type 'const unsigned char *'
> include/linux/fsnotify.h: In function 'fsnotify_link':
> include/linux/fsnotify.h:167: warning: pointer targets in passing argument 5 of 'fsnotify' differ in signedness
> include/linux/fsnotify_backend.h:300: note: expected 'const char *' but argument is of type 'const unsigned char *'
> include/linux/fsnotify.h: In function 'fsnotify_mkdir':
> include/linux/fsnotify.h:180: warning: pointer targets in passing argument 5 of 'fsnotify' differ in signedness
> include/linux/fsnotify_backend.h:300: note: expected 'const char *' but argument is of type 'const unsigned char *'
>
> I am not sure why these started turning up (they were there on Friday as
> well and I may have missed them earlier).

I cleaned up the all the sign warnings in the XFS code because
we mirror the kernel code into userspace for tool building (libxfs)
and that results in lots of sign warnings. I left the kernel
warnings switched on in the XFS makefile so we wouldn't re-introduce
the same problems.

Don't know why this isn't showing up in my build though, because:

CONFIG_FSNOTIFY=y

is set and it is obvious the fsnotify wrappers are passing an
unsigned char * (dentry name) to fsnotify() which takes a const char
* for the file name. There's mismatches like this all over the VFS,
so I'm not going to try to fix them....

The patch below should silence the warnings, though.

Cheers,

Dave.
--
Dave Chinner
[email protected]

xfs: turn off sign warnings

Because they cause warnings in static inline functions conditionally
compiled into XFS from the VFS (e.g. fsnotify).

Signed-off-by: Dave Chinner <[email protected]>
---
fs/xfs/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 1926701..5c5a366 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -16,7 +16,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

-EXTRA_CFLAGS += -I$(src) -I$(src)/linux-2.6 -Wpointer-sign
+EXTRA_CFLAGS += -I$(src) -I$(src)/linux-2.6

XFS_LINUX := linux-2.6

2010-02-08 18:01:49

by Eric Paris

[permalink] [raw]
Subject: Re: linux-next: vfs/fsnotify trees build warning

On Sun, Jan 24, 2010 at 11:29 PM, Dave Chinner <[email protected]> wrote:
> On Mon, Jan 25, 2010 at 03:04:56PM +1100, Stephen Rothwell wrote:
>> Hi Eric, Al,
>>
>> Today's linux-next build (x86_64 allmodconfig) produced these warnings:

I just switched fsnotify to use const unsigned char * so hopefully
they will shut up tomorrow....

-Eric

2010-02-08 19:37:07

by Christoph Hellwig

[permalink] [raw]
Subject: Re: linux-next: vfs/fsnotify trees build warning

On Mon, Feb 08, 2010 at 01:01:46PM -0500, Eric Paris wrote:
> On Sun, Jan 24, 2010 at 11:29 PM, Dave Chinner <[email protected]> wrote:
> > On Mon, Jan 25, 2010 at 03:04:56PM +1100, Stephen Rothwell wrote:
> >> Hi Eric, Al,
> >>
> >> Today's linux-next build (x86_64 allmodconfig) produced these warnings:
>
> I just switched fsnotify to use const unsigned char * so hopefully
> they will shut up tomorrow....

The xfs tree is also about to get a patch to turn off -Wpointer-sign
again. If it was up to me we should turn it on for the whole build,
we'll just need good way to deal with static initializers and strlen,
but some simple wrappers might do it for those.