[lkml]   [2010]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] netlink: fix gcc -Wconversion compilation warning
From: (Eric W. Biederman)
Date: Mon, 13 Dec 2010 13:35:25 -0800

> "Kirill A. Shutsemov" <> writes:
>> From: Dmitry V. Levin <>
>> $ cat << EOF | gcc -Wconversion -xc -S -o/dev/null -
>> unsigned f(void) {return NLMSG_HDRLEN;}
>> EOF
>> <stdin>: In function 'f':
>> <stdin>:3:26: warning: negative integer implicitly converted to unsigned type
> This doesn't look like a bad fix, but I believe things will fail if
> we give NLMSG_ALIGN an unsigned long like size_t. Say like sizeof.

What are you talking about? That's exactly his test case,
look at what NLMSG_HDRLEN is defined to, it's exactly the
case you're worried "will fail", it passes sizeof() to

I think I'll apply Kirill's original patch, it's good enough
and simpler.

 \ /
  Last update: 2010-12-17 21:05    [W:0.049 / U:5.572 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site