[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/lib/libc/stdio
Date: Sat, 23 Oct 2010 16:33:37 +0100
From: Matthias Scheler <tron%NetBSD.org@localhost>
| I'm sorry but this whole code is horrible.
I agree with that, but ...
| What is wrong with something as simple as this?
| +#define _FPOS_OVERFLOW(pos) ((pos) < LONG_MIN || (pos) > LONG_MAX)
That evaluates its arg 0, 1 or 2 times -- 0 if you're right and the wole
thing is sometimes optimised away, 1 if the value is < LONG_MIN, and twice
(most commonly) otherwise.
Macros that act like that without a very good reason are pure evil.
Main Index |
Thread Index |