Do not use C++ style comments (// comments). Strict ANSI C compilers do not accept them.
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/11/source-format.html
Description:
This sentence in the style guide feels outdated. // style comments have been
in the ANSI C standard for almost 20 years now (C99 was accepted as ANSI
standard in may 2000). I suggest rewording this to "Do not use C99 style
comments (// comments). Strict C89 compilers do not accept them." or come up
with some other reason for /**/ style being preferred to // style since I'm
not entierly convinced postgres compiles on C89 anyways.
On 2019-09-23 16:39, PG Doc comments form wrote:
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/11/source-format.html
Description:This sentence in the style guide feels outdated. // style comments have been
in the ANSI C standard for almost 20 years now (C99 was accepted as ANSI
standard in may 2000). I suggest rewording this to "Do not use C99 style
comments (// comments). Strict C89 compilers do not accept them." or come up
with some other reason for /**/ style being preferred to // style since I'm
not entierly convinced postgres compiles on C89 anyways.
PostgreSQL 12 requires C99, so those guidelines should probably be
rephrased from "because old compilers don't accept it" to "because we
like it that way".
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
PostgreSQL 12 requires C99, so those guidelines should probably be
rephrased from "because old compilers don't accept it" to "because we
like it that way".
Yeah, or more formally "to encourage consistent coding style".
regards, tom lane
On 2019-09-25 00:13, Tom Lane wrote:
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
PostgreSQL 12 requires C99, so those guidelines should probably be
rephrased from "because old compilers don't accept it" to "because we
like it that way".Yeah, or more formally "to encourage consistent coding style".
fixed
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
<div dir='auto'>Thanks for your attention! That sentence made me believe the style guide was outdated, but then I found fairly recent posts referring to it and got confused.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sep 26, 2019 10:53, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:<br type="attribution" /><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On 2019-09-25 00:13, Tom Lane wrote: <br>
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes: <br>
>> PostgreSQL 12 requires C99, so those guidelines should probably be <br>
>> rephrased from "because old compilers don't accept it" to "because we <br>
>> like it that way". <br>
> <br>
> Yeah, or more formally "to encourage consistent coding style". <br>
<br>
fixed <br>
<br>
-- <br>
Peter Eisentraut http://www.2ndQuadrant.com/&#13;<br>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services <br>
</p>
</blockquote></div><br></div>