Re: Walker/mutator prototype. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Walker/mutator prototype.
Date
Msg-id 3603.1071445501@sss.pgh.pa.us
Whole thread Raw
In response to Re: Walker/mutator prototype.  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> Kurt Roeckx <Q@ping.be> writes:
>> I did start by changing all the context's to void *, but you'll
>> loose the real type that it gets called with, so the other calls
>> will not generate warnings anymore because of wrong type.  

> But at least you'll get a warning if someone passes a non-pointer or an
> incorrect number of arguments altogether.

Note that in practice, the walker/mutator routines are not called from
random places, but by a *very* small number of macros used in clauses.c.
Thus, the probability that someone will introduce a bug into the call
sites is small, and the probability that they'd not discover it
instantly is even smaller.

Given that consideration, I don't see what the point is of trying to
tighten these prototypes.  ISTM it adds notational clutter for
essentially zero gain.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [PATCHES] fork/exec patch
Next
From: Tom Lane
Date:
Subject: Re: [pgsql-hackers-win32] [PATCHES] fork/exec patch