Re: [HACKERS] more on int8

From: Daniel Kalchev <daniel(at)digsys(dot)bg>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart), pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] more on int8
Date: 1998-09-11 07:09:03
Message-ID: 199809110709.KAA29536@dcave.digsys.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>Bruce Momjian said:
> > Just out of curiosity, does Bruce's BSDI system recognize %lld as did
> > Daniel's? If so, we could dispense with the %qd option for the final
> > release...
>
> Yes, BSDI understands %lld, but not %Ld, though it is not documented in
> the printf manual page.

It is documented in the scanf manual page, where it says:

l Indicates either that the conversion will be one of dioux or n
and the next pointer is a pointer to a long int (rather than
int), or that the conversion will be one of efg and the next
pointer is a pointer to double (rather than float). If the con-
version is dioux or n and two l flags are given, then the next
pointer will be a pointer to a double precision integer of quad_t
or u_quad_t (unsigned) type; these types are defined in
<sys/types.h>.

L Indicates that the conversion will be efg and the next pointer is
a pointer to long double. (This type is not implemented; the L
flag is currently ignored.)

q Indicates a double precision integer conversion; identical to us-
ing ll.

Note the reference to u_quad_t - there is also quad_t in BSD/OS 3.1 which is
singned. There are also (identical) types

typedef u_int64_t u_quad_t; /* quads */
typedef int64_t quad_t;

The same is valid for BSD/OS 4.0.

> We could probably do without %qd, but I assume their are some platforms
> that support %qd and not %lld. We can ask people as they run configure
> if they ever see %lld failing but %qd passing.

Perhaps %lld is GNUism? So it should work on most GNU based compilers. I agree
your approach is good - to just sample the different platforms on which
PostgreSQL is compiled.

Daniel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Ivar Helbekkmo 1998-09-11 08:36:57 Names that suddenly include an OID
Previous Message Bruce Momjian 1998-09-11 06:14:28 Re: [HACKERS] more on int8