Re: pgsql: Clarify coding of .exe patch - Mailing list pgsql-committers

From Neil Conway
Subject Re: pgsql: Clarify coding of .exe patch
Date
Msg-id 1099286793.17405.2.camel@localhost.localdomain
Whole thread Raw
In response to Re: pgsql: Clarify coding of .exe patch  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: pgsql: Clarify coding of .exe patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Mon, 2004-11-01 at 16:04, Bruce Momjian wrote:
> I prefer strlen() myself but Tom prefers sizeof().  In the long run I
> would like to create a 'sizeof' that doesn't include the null as a
> global define that we can use for any hard-coded string.

Tom, can you elaborate on why you prefer sizeof()? ISTM that a decent
compiler will evaluate the strlen() at compile-time if the argument is a
compile-time constant. GCC will do this (even at -O0!), for example.

-Neil



pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgsql: Clarify coding of .exe patch
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Clarify coding of .exe patch