lkml.org 
[lkml]   [2011]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [resend][PATCH] fs: use kernel's hex_to_bin() method
Date
Andrew Morton <akpm@linux-foundation.org> wrote:

> Not a terribly convenient convenience, as most callers will need to cast
> away the constness of the return value. Oh well, those callers should
> have been using a `const char *' anyway.

Maybe. You could always do as strchr():

char *strchr(const char *s, int c);

Then you don't need to cast the result. The problem[*] is that you can't tell
the compiler that the return value should carry the same constness as one of
the arguments because you don't have something like C++ templates.

[*] If indeed not having C++ or templates should be seen as a problem...

David


\
 
 \ /
  Last update: 2011-01-05 10:57    [W:0.069 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site