[lkml]   [2001]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: macro conflict
From: <>
> Without digging through the archives to see if this has already
> been suggested (if so, I apologize), why can't the following be done:
> min(x,y) = ({typeof((x)) __x=(x), __y=(y); (__x < __y) ? __x : __y})
> That gets you the correct "evaluate the args once" semantics and gives
> you control over typing (the comparison is done in the type of the
> first argument) and we don't have to change a zillion drivers.
> (typeof() is a gcc extension.)

But then again, how do you know it's the type of x we want, maybe we want
type of y, that is and signed char (not an int like x).
Talk about hidden buffer overflow stuff :)


Programmer/Networker [|] Magnus Naeslund
PGP Key:

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:58    [W:0.480 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site