lkml.org 
[lkml]   [2011]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] remove abs64()
On Wed, 13 Apr 2011 00:16:58 +0300
Alexey Dobriyan <adobriyan@gmail.com> wrote:

> On Tue, Apr 12, 2011 at 02:10:40PM -0700, Andrew Morton wrote:
> > On Tue, 12 Apr 2011 14:07:26 -0700
> > Randy Dunlap <rdunlap@xenotime.net> wrote:
> >
> > > > + __builtin_choose_expr( \
> > > > + __builtin_types_compatible_p(typeof(_x), long long), \
> > > > + (unsigned long long)({ _x < 0 ? -_x : _x; }), \
> > > > + _x))))); \
> > > > +})
> > >
> > > that is better?
> >
> > I think so.
> >
> > It's a bit concerning that it changes the return type of abs().
>
> I haven't read every abs() user, but, yes, sizeof(abs()) silently
> changing is the issue.

It changes signedness_of(abs(signed_expr)) as well. That changes the
signedness of expressions which use abs() and on and on.


\
 
 \ /
  Last update: 2011-04-12 23:35    [W:1.110 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site