| From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
|---|---|
| To: | Nathan Bossart <nathandbossart(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Documenting coding style |
| Date: | 2026-04-15 18:10:59 |
| Message-ID: | f232a120-8d7c-42d5-9e50-249c49b6f1ed@eisentraut.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 10.04.26 16:49, Nathan Bossart wrote:
>> I wonder if we should move the coding style section out of sgml into a
>> top-level CODING_STYLE.md or something like that.
>>
>> And then obviously add things like Size being deprecated.
> Unless we're going to actually remove the typedef in the near future, I'm
> not sure I'd support even marking it deprecated. If we're going to keep it
> around indefinitely, that's just going to become another source of nitpicks
> when new contributors inevitably copy/paste some code from the aughts. A
> style page makes the situation a little better, but it's yet another thing
> that folks have to remember.
In this case, if one wanted to do something, one should at least enhance
the code comment for Size, which is currently very bare and doesn't
explain why the type exists.
As some counterexamples, some of which I wrote:
/*
* Pointer
* Variable holding address of any memory resident object.
* (obsolescent; use void * or char *)
*/
typedef void *Pointer;
/* Historical names for types in <stdint.h>. */
typedef int8_t int8;
...
* We require C11 and C++11, so static_assert() is expected to be there.
* StaticAssertDecl() was previously used for portability, but it's now
just a
* plain wrapper and doesn't need to be used in new code.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2026-04-15 18:13:46 | Re: Do we still need gen_node_support.pl's nodetag ABI stability check? |
| Previous Message | Peter Eisentraut | 2026-04-15 18:03:55 | Re: DOCS - Add introductory paragraph to Getting Started chapter |