Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/stdio



On Sun, Oct 24, 2010 at 09:55:21AM +0700, Robert Elz wrote:
>     Date:        Sat, 23 Oct 2010 16:33:37 +0100
>     From:        Matthias Scheler <tron%NetBSD.org@localhost>
>     Message-ID:  <20101023153336.GA822%colwyn.zhadum.org.uk@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.

It doesn't have to be a macro anyway as it used only ones.

        Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/


Home | Main Index | Thread Index | Old Index