Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 2010 07:59:08 -0700
From:      Neel Natu <neelnatu@gmail.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder <stefanf@freebsd.org>, src-committers@freebsd.org, "Jayachandran C." <c.jayachandran@gmail.com>
Subject:   Re: svn commit: r211130 - head/libexec/rtld-elf/mips
Message-ID:  <AANLkTi=Jg=r7Etiy5%2BpqjibwHPvO-6BkE5Qss6y7nDUH@mail.gmail.com>
In-Reply-To: <20100810215430.U10154@delplex.bde.org>
References:  <201008100515.o7A5FZZF017552@svn.freebsd.org> <20100810062829.GA1737@mole.fafoe.narf.at> <AANLkTimwoLfMXrNb7NmG%2BHWonug1-asmNdAE9AcSNHkK@mail.gmail.com> <AANLkTinkTQ25Dv6giE2HnWFrq7fuPReYFmwVb5oEy92s@mail.gmail.com> <20100810074210.GC1737@mole.fafoe.narf.at> <20100810215430.U10154@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Tue, Aug 10, 2010 at 5:00 AM, Bruce Evans <brde@optusnet.com.au> wrote:
> On Tue, 10 Aug 2010, Stefan Farfeleder wrote:
>
>> On Tue, Aug 10, 2010 at 12:55:38PM +0530, Jayachandran C. wrote:
>>>
>>> I think there is a problem in =A0sys/mips/include/_endian.h
>>> --
>>> #define __bswap16(x) =A0 =A0(__uint16_t)(__is_constant(x) ? =A0 =A0 =A0=
 =A0 \
>>> =A0 =A0 =A0 =A0__bswap16_const((__uint16_t)x) : =A0__bswap16_var((__uin=
t16_t)x))
>>> #define __bswap32(x) =A0 =A0(__uint32_t)(__is_constant(x) ? =A0 =A0 =A0=
 =A0 \
>>> =A0 =A0 =A0 =A0__bswap32_const((__uint32_t)x) : =A0__bswap32_var((__uin=
t32_t)x))
>>> #define __bswap64(x) =A0 =A0(__uint64_t)(__is_constant(x) ? =A0 =A0 =A0=
 =A0 \
>>> =A0 =A0 =A0 =A0__bswap64_const((__uint64_t)x) : =A0__bswap64_var((__uin=
t64_t)x))
>>> --
>>>
>>> I'm not sure why the cast is needed, but we should have a braces
>>> around x, unless I'm completely mistaken.
>
> And not around x in callers.
>
>> I agree. And around the entire expression too.
>
> I agree. =A0But I've never seen a case where foo(x) needs to be (foo(x))
> (where foo is not a macro). =A0'()' has highest precedence for expression=
s
> (not sure about for parameter lists) together with `[]' `->' and '.', and
> it is hard to think of an expression with any of the latter close enough
> to foo(x) to cause problems.
>
> Bruce
>

Ok, thanks to everybody for their input. I'll make the suggested
changes to sys/mips/include/_endian.h instead.

best
Neel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=Jg=r7Etiy5%2BpqjibwHPvO-6BkE5Qss6y7nDUH>