AIX check in datetime.h - Mailing list pgsql-hackers

From Joachim Wieland
Subject AIX check in datetime.h
Date
Msg-id 20060606103311.GA2667@mcknight.de
Whole thread Raw
Responses Re: AIX check in datetime.h  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Can someone please explain why in include/utils/datetime.h (struct datetkn)
there is a check for _AIX that either initializes a char* pointer or a char
array? Is there any advantage of a char-array except for warnings of some
compilers if the initilization string is too long?

Apart from that I doubt that AIX cannot handle token[TOKMAXLEN] because
similar declarations can be found in other headers without the _AIX check.

The struct definition is more than 9 years old and seems to show up first in
Attic/dt.h.


#define TOKMAXLEN       10      /* only this many chars are stored in                                * datetktbl */

/* keep this struct small; it gets used a lot */
typedef struct
{
#if defined(_AIX)   char       *token;
#else   char        token[TOKMAXLEN];
#endif   /* _AIX */   char        type;   char        value;          /* this may be unsigned, alas */
} datetkn;


Joachim



pgsql-hackers by date:

Previous
From: Travis Cross
Date:
Subject: Duplicate rows sneaking in despite PRIMARY KEY / UNIQUE constraint
Next
From: Simon Riggs
Date:
Subject: Re: fillfactor using WITH syntax