Re: Coding style point: "const" in function parameter declarations - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Coding style point: "const" in function parameter declarations
Date
Msg-id BANLkTi=7Ekhy3o1QPMG5ue44j6TATU-ur4_wE_kdbZQc1p315Q@mail.gmail.com
Whole thread Raw
In response to Re: Coding style point: "const" in function parameter declarations  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Coding style point: "const" in function parameter declarations
Re: Coding style point: "const" in function parameter declarations
List pgsql-hackers
On Wed, Jun 22, 2011 at 5:41 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> If we were thinking of moving in that direction, I would argue that
> we should get rid of typedef'd pointers altogether, ie, change
> "Relation" to be a typedef for the struct and write "Relation *rel"
> not "Relation rel".

Hm. I have to say the single most confusing thing about the Postgres
source that took me a *long* time to get over was remembering that
some of the typedefs were already pointers and some weren't. It seems
silly now but when I was trying to understand what the intent of a
function was and it wasn't obvious that some of the arguments appeared
to be pass by value but were actually pass by reference it made things
really surprising.


-- 
greg


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: SYNONYMS (again)
Next
From: Tom Lane
Date:
Subject: Re: Coding style point: "const" in function parameter declarations