Re: [BUGS] My postmaster just crashed ! - Mailing list pgsql-general

From Michael Fuhr
Subject Re: [BUGS] My postmaster just crashed !
Date
Msg-id 20050127201038.GA46811@winnie.fuhr.org
Whole thread Raw
In response to Re: [BUGS] My postmaster just crashed !  ("Frank D. Engel, Jr." <fde101@fjrhome.net>)
List pgsql-general
On Thu, Jan 27, 2005 at 03:00:06PM -0500, Frank D. Engel, Jr. wrote:

> I think it is an internal thing with gcc that the size of a pointer and
> sizeof(int) are always the same, regardless of machine word size...
> with a 64-bit binary, sizeof(int) and sizeof(void *) should both be 8,
> which still causes them to be equal.

Not with gcc 3.4.2 on Solaris 9/sparc -- maybe you're thinking of
sizeof(long).

% cat foo.c
#include <stdio.h>

int
main(void)
{
    printf("sizeof(void *) = %d\n", sizeof(void *));
    printf("sizeof(int)    = %d\n", sizeof(int));
    printf("sizeof(long)   = %d\n", sizeof(long));
    return 0;
}

% gcc -m32 -o foo foo.c
% ./foo
sizeof(void *) = 4
sizeof(int)    = 4
sizeof(long)   = 4

% gcc -m64 -o foo foo.c
% ./foo
sizeof(void *) = 8
sizeof(int)    = 4
sizeof(long)   = 8

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: convert mdb files to pg?
Next
From: David Fetter
Date:
Subject: Re: convert mdb files to pg?