pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Do not use C++ style comments (// comments). Strict ANSI C compilers do not accept them.
5+ messages / 4 participants
[nested] [flat]

Commits from this thread:
  2019-09-26 49e36e7901 b4d615aaa1  doc: Update note about source code formatting
* Do not use C++ style comments (// comments). Strict ANSI C compilers do not accept them.
@ 2019-09-23 14:39  PG Doc comments form <noreply@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: PG Doc comments form @ 2019-09-23 14:39 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: andast@kth.se

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.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Do not use C++ style comments (// comments). Strict ANSI C compilers do not accept them.
@ 2019-09-24 22:11  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: PG Doc comments form <noreply@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Eisentraut @ 2019-09-24 22:11 UTC (permalink / raw)
  To: andast@kth.se; pgsql-docs@lists.postgresql.org

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





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Do not use C++ style comments (// comments). Strict ANSI C compilers do not accept them.
@ 2019-09-24 22:13  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2019-09-24 22:13 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: andast@kth.se; pgsql-docs@lists.postgresql.org

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





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Do not use C++ style comments (// comments). Strict ANSI C compilers do not accept them.
@ 2019-09-26 08:53  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Eisentraut @ 2019-09-26 08:53 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: andast@kth.se; pgsql-docs@lists.postgresql.org

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





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Do not use C++ style comments (// comments). Strict ANSI C compilers do not accept them.
@ 2019-09-30 09:18  Anders Åstrand <andast@kth.se>
  parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Anders Åstrand @ 2019-09-30 09:18 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-docs@lists.postgresql.org

<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 &lt;peter.eisentraut@2ndquadrant.com&gt; 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:&#13;<br>
&gt; Peter Eisentraut &lt;peter.eisentraut@2ndquadrant.com&gt; writes:&#13;<br>
&gt;&gt; PostgreSQL 12 requires C99, so those guidelines should probably be&#13;<br>
&gt;&gt; rephrased from "because old compilers don't accept it" to "because we&#13;<br>
&gt;&gt; like it that way".&#13;<br>
&gt; &#13;<br>
&gt; Yeah, or more formally "to encourage consistent coding style".&#13;<br>
&#13;<br>
fixed&#13;<br>
&#13;<br>
-- &#13;<br>
Peter Eisentraut&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.2ndQuadrant.com/&#13;<br;
PostgreSQL Development, 24x7 Support, Remote DBA, Training &amp; Services&#13;<br>
</p>
</blockquote></div><br></div>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2019-09-30 09:18 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23 14:39 Do not use C++ style comments (// comments). Strict ANSI C compilers do not accept them. PG Doc comments form <noreply@postgresql.org>
2019-09-24 22:11 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2019-09-24 22:13   ` Tom Lane <tgl@sss.pgh.pa.us>
2019-09-26 08:53     ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2019-09-30 09:18       ` Anders Åstrand <andast@kth.se>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox