Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] lojza.h: release early, release often . . . . . . . .
- Date: Fri, 28 Jul 2006 11:28:53 +0100
- From: "Ian Wells" <ijw@example.com>
- Subject: Re: [tlug] lojza.h: release early, release often . . . . . . . .
- References: <20060726125907.GH5111@example.com> <20060727081940.GM5111@example.com> <20060727120544.6e18e45f.jep200404@example.com> <87vepia17q.fsf@example.com>
Yum, troll. I like troll. *Chomp* ;-) On 28/07/06, Stephen J. Turnbull <stephen@example.com> wrote:>>>>> "Jim" == Jim <jep200404@example.com> writes: Jim> I've learned to add parentheses around #define values as a Jim> matter of routine to avoid suprises. Good luck! There are all kinds of ways this can trip you up if you're actually doing anything complex enough for it to help.I think it's safer to put them in than not, because you're reducing the number of circumstances where you get bitten. Generally a good idea to stick brackets around parameters used in defines too...Really, you should be aiming at exactly the necessary number of parentheses.#define thing(a, b, c) a&b|c /* let's say this is exactly what you meant, with the minimum number of parentheses */ retval=thing(x|y, z&w, v)&e|f /* however, this almost certainly isn't what you meant at all */If it starts turning into work to get them right, it's time to think about strategies for avoiding use of #define.This is what made me bite. #define is crufty, I agree, but inline is not C89 (and most compilers aren't C99, and since I'm on a project with no fixed processor or toolchain at the moment I'm quite appreciative of people who keep their code portable). And enum {x=1.23} simply doesn't work. -- Ian.
- Follow-Ups:
- Re: [tlug] lojza.h: release early, release often . . . . . . . .
- From: Stephen J. Turnbull
- References:
- [tlug] issues with format of double (or IEEE754)
- From: Michal Hajek
- [tlug] just a quick note... more to come later :)
- From: Michal Hajek
- [tlug] lojza.h: release early, release often . . . . . . . . (was Re: just a quick note... more to come later :))
- From: Jim
- Re: [tlug] lojza.h: release early, release often . . . . . . . .
- From: Stephen J. Turnbull
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] just a quick note... more to come later :)
- Next by Date: Re: [tlug] Internal floating point formats used by 80387, IEEE 754 and C . . . . .
- Previous by thread: Re: [tlug] lojza.h: release early, release often . . . . . . . .
- Next by thread: Re: [tlug] lojza.h: release early, release often . . . . . . . .
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links