Re: Something's been bugging me

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Something's been bugging me
Date: 2007-09-30 22:59:48
Message-ID: 6717.1191193188@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> Why do you cast arguments to memcmp to char* ?

Well, *I* haven't done it in a long time, but it used to be a fairly
standard thing. I imagine that back before memcpy was usually declared
with void * arguments, it was necessary to avoid compiler warnings.

The problem would still exist if the code were written
memcpy((void *) &foo, ...)
so I suspect that an in-line cast to void * wouldn't work any better.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-09-30 23:26:22 Re: Something's been bugging me
Previous Message Tom Lane 2007-09-30 22:46:58 Latest ecpg patch broke MSVC build