- To: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxx>
- Subject: Re: [PATCH 00/16] mm: prepare for converting vm->vm_flags to 64-bit
- From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 22 Mar 2012 16:09:44 -0700
- Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Minchan Kim <minchan@xxxxxxxxxx>, "linux-mm@xxxxxxxxx" <linux-mm@xxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Hugh Dickins <hughd@xxxxxxxxxx>, KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>, Ben Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, "linux@xxxxxxxxxxxxxxxx" <linux@xxxxxxxxxxxxxxxx>, Christopher Li <sparse@xxxxxxxxxxx>
- Delivered-to: linux-mm-outgoing@xxxxxxxxx
- Delivered-to: int-list-linux-mm@xxxxxxxxx
- Delivered-to: linux-mm@xxxxxxxxx
- In-reply-to: <4F6BAD15.90802@openvz.org>
On Fri, 23 Mar 2012 02:52:05 +0400
Konstantin Khlebnikov <khlebnikov@xxxxxxxxxx> wrote:
> >> Is this ok?
> >
> > Yes.
> >
> > The thing about __nocast is that it's so *very* very easy to lose it.
> > For example, do this:
> >
> > typedef long __nocast long_t;
> >
> > int main(long_t a)
> > {
> > return a;
> > }
> >
> > and you get the (expected) warning.
> >
> > HOWEVER. Now do "return a+1" instead, and the warning goes away. Why?
> > Because the expression ends up having just the type "long", because
> > the "a" mixed happily with the "1" (that was cast from 'int' to 'long'
> > by the normal C type rules).
> >
> > That is arguably a bug, but this kind of thing really wasn't what
> > __nocast was designed for. The __nocast design ended up being too
> > weak, though, and we hardly use it in the kernel.
> >
>
> Thanks. Looks like "__nocast" totally undocumented.
> It would be nice to add something about this into Documentation/sparse.txt
Yup, Chris has added this to his todo list (thanks!).
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>
[Site Home]
[Linux ARM Kernel]
[Linux ARM]
[Linux Omap]
[Fedora ARM]
[IETF Annouce]
[Security]
[Bugtraq]
[Linux]
[Linux OMAP]
[Linux MIPS]
[ECOS]
[Tools]
[DDR & Rambus]
[Asterisk Internet PBX]
[Linux API]
[Monitors]