Messages in this thread | | | Date | Mon, 11 Aug 2003 07:30:59 +0200 | From | Willy Tarreau <> | Subject | Re: [PATCH] 2.4.22pre10: {,un}likely_p() macros for pointers |
| |
On Sun, Aug 10, 2003 at 10:39:12PM -0400, Chip Salzenberg wrote:
> Both parameters of __builtin_expect() are long ints. On an > architecture where there's a pointer type larger than long[1], > __builtin_expect() won't just warn, it'll *fail*. Also, on an > architecture where a conversion of a null pointer to long results in > a non-zero value[2], it'll *fail*. That makes it non-portable twice > over. Wouldn't you agree?
Hmmm Chip, on the document you suggested us to read, I remember a statement about (!x) <=> (x == 0) which implied it's legal even if x is a pointer because the compiler will automatically do the comparison between x and NULL and not (int)x and 0. Perhaps I have dreamed, but I'm sure I read this. So in any case, the !!(x) construct should be valid.
Cheers, Willy
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |