Re: Coding style point: "const" in function parameter declarations

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Dan Ports" <drkp(at)csail(dot)mit(dot)edu>,<pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Coding style point: "const" in function parameter declarations
Date: 2011-06-22 16:06:06
Message-ID: 4E01CC9E020000250003EA9C@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> 2. In cases such as "const Relation foo" where the parameter type
> is a typedeffed pointer, it is easy for readers to arrive at the
> false conclusion that this guarantees the function doesn't change
> the pointed-to structure.

So easy that in fact that was my belief when I wrote it. Since that
was wrong, I totally support the (now accomplished) removal of the
useless and misleading qualifier. Thanks for spotting this mistaken
assumption.

-Kevin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2011-06-22 16:24:42 Re: Coding style point: "const" in function parameter declarations
Previous Message Magnus Hagander 2011-06-22 15:55:06 Re: pg_dump vs malloc