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

From Bruce Momjian
Subject Re: pgsql: Clarify coding of .exe patch
Date
Msg-id 200411010504.iA154DE15933@candle.pha.pa.us
Whole thread Raw
In response to Re: pgsql: Clarify coding of .exe patch  (Neil Conway <neilc@samurai.com>)
Responses Re: pgsql: Clarify coding of .exe patch  (Neil Conway <neilc@samurai.com>)
List pgsql-committers
Neil Conway wrote:
> On Mon, 2004-11-01 at 15:47, Bruce Momjian wrote:
> > Oh, I didn't realize they had the dot in there.  Let me add "-1".
> > Thanks.  Attached.
>
> I wonder if it wouldn't be cleaner to #define SIZE_OF_EXE or similar
> that includes the "-1". Alternatively, we could just use strlen(): I
> believe a decent compiler should be able to evaluate strlen("str") at
> compile-time.

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.  I have not
thought of a name yet and it would be for 8.1.  I count perhaps 84
places it could be used:

    $ rgrepc 'sizeof.*- \?1'|wc -l
          84

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-committers by date:

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