lkml.org 
[lkml]   [2013]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pid: change task_struct::pid to read-only
On Fri, Dec 20, 2013 at 08:01:57PM +0100, Oleg Nesterov wrote:
> The only problem is that
>
> #define ASSIGN_CONST(l, r) (*(typeof(r) *)&(l) = (r))
>
> obviously can't work in this case ;) We need something more clever.

Hmm indeed, C++ has both the const_cast<>() thingy and the template
system is powerful enough to actually implement const_cast<>() inside
the language.

But I cannot find anything useful for C. Your attempt to use the rvalue
type to hopefully obtain a const-less lvalue type is clever, but does
indeed fail where the rvalue is const too.




\
 
 \ /
  Last update: 2013-12-20 22:41    [W:0.308 / U:2.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site