From: Linus Torvalds on


On Fri, 26 Mar 2010, David Daney wrote:
>
> The GCC built-in __builtin_prefetch() is a vargs function. If we
> don't wrap the macro parameter in parentheses, a comma operator in the
> actual argument list might cause unintended parameters to be passed to
> __builtin_prefetch().

This seems totally pointless and actively wrong.

You cannot have a comma operator in the actual argument list to the
#define, because if you did, then you'd get a

macro "prefetch()" passed 2 arguments, but takes just 1

so the only way I see to pass a comma operator is to _already_ have the
macro parameter in parenthesis.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Linus Torvalds on


On Fri, 26 Mar 2010, David Daney wrote:

> On 03/26/2010 02:04 PM, Linus Torvalds wrote:
> >
> >
> > On Fri, 26 Mar 2010, David Daney wrote:
> > >
> > > The GCC built-in __builtin_prefetch() is a vargs function. If we
> > > don't wrap the macro parameter in parentheses, a comma operator in the
> > > actual argument list might cause unintended parameters to be passed to
> > > __builtin_prefetch().
> >
> > This seems totally pointless and actively wrong.
>
> Pointless, perhaps. But 'actively wrong'? Are you sure about that?

Yes, I'm sure about that.

Your commit message was actively misleading, and the end result is worse
than the original and shows a lack of understanding of the C preprocessor.

IOW, very much "actively wrong".

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: David Daney on
On 03/26/2010 02:04 PM, Linus Torvalds wrote:
>
>
> On Fri, 26 Mar 2010, David Daney wrote:
>>
>> The GCC built-in __builtin_prefetch() is a vargs function. If we
>> don't wrap the macro parameter in parentheses, a comma operator in the
>> actual argument list might cause unintended parameters to be passed to
>> __builtin_prefetch().
>
> This seems totally pointless and actively wrong.

Pointless, perhaps. But 'actively wrong'? Are you sure about that?

In any event I guess I don't care much one way or the other. I was
working on something else when I saw this. It looked wrong to me.

Thanks,
David Daney


>
> You cannot have a comma operator in the actual argument list to the
> #define, because if you did, then you'd get a
>
> macro "prefetch()" passed 2 arguments, but takes just 1
>
> so the only way I see to pass a comma operator is to _already_ have the
> macro parameter in parenthesis.
>
> Linus

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/