Re: Small changes to facilitate Win32 port - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: Small changes to facilitate Win32 port
Date
Msg-id 3CF77DED.202048DA@fourpalms.org
Whole thread Raw
In response to Small changes to facilitate Win32 port  (Katherine Ward <kward6@yahoo.com>)
Responses Re: Small changes to facilitate Win32 port
List pgsql-hackers
> >> 2.  Add _P to the following lex/yacc tokens to avoid collisions
> >> CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT
> I'm tempted to suggest that we should stick _P on *all* the lexer token
> symbols, rather than having an inconsistent set of names where some of
> them have _P and some do not.  Or perhaps _T (for token) would be a more
> sensible convention; I'm not sure why _P was used in the first place.

"P" for "Parser". The symbols are used past the lexer, but are isolated
to other places in the parser, and are (or should be) stripped out
beyond there.

> >> 3.  Rename two local macros
> >> a.  MEM_FREE => MEM_FREE_IT in backend/utils/hash/dynahash.c
> >> b.  IGNORE => IGNORE_TOK in include/utils/datetime.h &
> >> backend/utils/adt/datetime.c
> It's fairly amazing that IGNORE is the only one of the datetime.h field
> names that's bitten anyone (so far).  Macros named TZ, YEAR, MONTH, DAY,
> HOUR, MINUTE, SECOND, UNITS all look like trouble waiting to happen
> (and UNKNOWN_FIELD looks like someone already had to beat a retreat from
> calling it UNKNOWN ;-)).  I'm inclined to suggest that these names
> should be uniformly changed to DTF_FOO (DTF for "datetime field").
> The macro names appearing before the field name list look like trouble
> as well --- anyone have an interest in changing them?  Thomas, this is
> pretty much your turf; what do you think?

If the lexer/parser should have postfix qualifiers, let's use postfix
for other naming conventions too (or switch everything to prefix, but be
consistant in the conventions).

No problem with qualifying the names, though you have likely overstated
the case for it; "fairly amazing" after 6 years of use on over a dozen
platforms probably qualifies as a good test of reality and we aren't
quite to the point of having to invoke miracles and magic to explain why
it works ;)

In any case, we would certainly be open to accepting patches for the
limited number of cases Katherine has identified, and would welcome
patches which are more comprehensive if they were available.
                     - Thomas


pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Small changes to facilitate Win32 port
Next
From: Tom Lane
Date:
Subject: Re: Small changes to facilitate Win32 port