pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Remove extra comma at end of enum list
16+ messages / 10 participants
[nested] [flat]
* pgsql: Remove extra comma at end of enum list
@ 2016-10-23 13:57 Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Magnus Hagander @ 2016-10-23 13:57 UTC (permalink / raw)
To: pgsql-committers
Remove extra comma at end of enum list
C99-specific feature, and wasn't intentional in the first place.
Per buildfarm member mylodon
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/d97a59a4c5597af5f53869a5a1c753893752c66b
Modified Files
--------------
src/bin/pg_basebackup/walmethods.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
@ 2016-10-24 04:51 ` Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
0 siblings, 1 reply; 16+ messages in thread
From: Michael Paquier @ 2016-10-24 04:51 UTC (permalink / raw)
To: Magnus Hagander <magnus@hagander.net>; +Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
(Moved to -hackers)
On Sun, Oct 23, 2016 at 10:57 PM, Magnus Hagander <magnus@hagander.net> wrote:
> Remove extra comma at end of enum list
>
> C99-specific feature, and wasn't intentional in the first place.
>
> Per buildfarm member mylodon
This is the second time I see that in the last couple of weeks. Would
it be better to use some custom CFLAGS to detect that earlier in the
review process? I have never much used gcc's std or clang extensions
in this area. Has somebody any recommendations?
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
@ 2016-10-24 06:36 ` Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 16+ messages in thread
From: Fabien COELHO @ 2016-10-24 06:36 UTC (permalink / raw)
To: Michael Paquier <michael.paquier@gmail.com>; +Cc: Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
>> C99-specific feature, and wasn't intentional in the first place.
>>
>> Per buildfarm member mylodon
>
> This is the second time I see that in the last couple of weeks. Would
> it be better to use some custom CFLAGS to detect that earlier in the
> review process? I have never much used gcc's std or clang extensions
> in this area. Has somebody any recommendations?
My 0.02€, I've used the following for years without problem, but it would
need testing with a several versions of gcc & clang before committing:
sh> gcc -std=c89/... ...
sh> clang -std=c89/... ...
And a free advice, hoping not to start a troll:
Even as conservative and old fashioned as I am, I was 18 in 1989 and had a
driving license. In 2017 C99 will also turn 18 and might be considered old
and stable enough for pg:-)
I find it annoying that "//" comments are not supported, or having to
declare variables at the beginning of a block instead of when first
used...
--
Fabien.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
@ 2016-10-24 18:31 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 21:13 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
0 siblings, 2 replies; 16+ messages in thread
From: Alvaro Herrera @ 2016-10-24 18:31 UTC (permalink / raw)
To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: Michael Paquier <michael.paquier@gmail.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Fabien COELHO wrote:
> I find it annoying that "//" comments are not supported, or having to
> declare variables at the beginning of a block instead of when first used...
I think some c99 features would be nice (variadic macros for one), but
those particular two get a big "meh" from me.
.oO( I wonder if it'd be possible to make ereport() an inline function ... )
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2016-10-24 19:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 19:11 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Stephen Frost <sfrost@snowman.net>
2016-10-24 19:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Bruce Momjian <bruce@momjian.us>
2016-10-24 20:49 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
1 sibling, 3 replies; 16+ messages in thread
From: Tom Lane @ 2016-10-24 19:03 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Fabien COELHO <coelho@cri.ensmp.fr>; Michael Paquier <michael.paquier@gmail.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Fabien COELHO wrote:
>> I find it annoying that "//" comments are not supported, or having to
>> declare variables at the beginning of a block instead of when first used...
> I think some c99 features would be nice (variadic macros for one), but
> those particular two get a big "meh" from me.
Yeah. Personally, I'd want to continue the rule against // comments just
as a matter of maintaining stylistic consistency. Code that's got a
random mishmash of // and /* comments looks messy, if you ask me.
An alternative that would be worth considering is to adopt a uniform
rule of // for line-ending comments and /* for all other uses. We'd
have to teach pgindent about that, and I dunno how hard that is.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-10-24 19:11 ` Stephen Frost <sfrost@snowman.net>
2016-10-24 20:53 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Petr Jelinek <petr@2ndquadrant.com>
2 siblings, 1 reply; 16+ messages in thread
From: Stephen Frost @ 2016-10-24 19:11 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Fabien COELHO <coelho@cri.ensmp.fr>; Michael Paquier <michael.paquier@gmail.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Fabien COELHO wrote:
> >> I find it annoying that "//" comments are not supported, or having to
> >> declare variables at the beginning of a block instead of when first used...
>
> > I think some c99 features would be nice (variadic macros for one), but
> > those particular two get a big "meh" from me.
>
> Yeah. Personally, I'd want to continue the rule against // comments just
> as a matter of maintaining stylistic consistency. Code that's got a
> random mishmash of // and /* comments looks messy, if you ask me.
+1
> An alternative that would be worth considering is to adopt a uniform
> rule of // for line-ending comments and /* for all other uses. We'd
> have to teach pgindent about that, and I dunno how hard that is.
I'm not sure it's worth the resulting mess.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 19:11 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Stephen Frost <sfrost@snowman.net>
@ 2016-10-24 20:53 ` Petr Jelinek <petr@2ndquadrant.com>
0 siblings, 0 replies; 16+ messages in thread
From: Petr Jelinek @ 2016-10-24 20:53 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Fabien COELHO <coelho@cri.ensmp.fr>; Michael Paquier <michael.paquier@gmail.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
On 24/10/16 21:11, Stephen Frost wrote:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
>>> Fabien COELHO wrote:
>>>> I find it annoying that "//" comments are not supported, or having to
>>>> declare variables at the beginning of a block instead of when first used...
>>
>>> I think some c99 features would be nice (variadic macros for one), but
>>> those particular two get a big "meh" from me.
>>
>> Yeah. Personally, I'd want to continue the rule against // comments just
>> as a matter of maintaining stylistic consistency. Code that's got a
>> random mishmash of // and /* comments looks messy, if you ask me.
>
> +1
>
+1
>> An alternative that would be worth considering is to adopt a uniform
>> rule of // for line-ending comments and /* for all other uses. We'd
>> have to teach pgindent about that, and I dunno how hard that is.
>
> I'm not sure it's worth the resulting mess.
>
I think the current commenting style stylistically nicer.
--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-10-24 19:51 ` Bruce Momjian <bruce@momjian.us>
2 siblings, 0 replies; 16+ messages in thread
From: Bruce Momjian @ 2016-10-24 19:51 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Fabien COELHO <coelho@cri.ensmp.fr>; Michael Paquier <michael.paquier@gmail.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
On Mon, Oct 24, 2016 at 03:03:19PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Fabien COELHO wrote:
> >> I find it annoying that "//" comments are not supported, or having to
> >> declare variables at the beginning of a block instead of when first used...
>
> > I think some c99 features would be nice (variadic macros for one), but
> > those particular two get a big "meh" from me.
>
> Yeah. Personally, I'd want to continue the rule against // comments just
> as a matter of maintaining stylistic consistency. Code that's got a
> random mishmash of // and /* comments looks messy, if you ask me.
>
> An alternative that would be worth considering is to adopt a uniform
> rule of // for line-ending comments and /* for all other uses. We'd
> have to teach pgindent about that, and I dunno how hard that is.
I think it would be easy to teach pg_indent.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-10-24 20:49 ` Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 21:59 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2 siblings, 1 reply; 16+ messages in thread
From: Fabien COELHO @ 2016-10-24 20:49 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Michael Paquier <michael.paquier@gmail.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
>>> I find it annoying that "//" comments are not supported, or having to
>>> declare variables at the beginning of a block instead of when first used...
>
>> I think some c99 features would be nice (variadic macros for one), but
>> those particular two get a big "meh" from me.
>
> Yeah. Personally, I'd want to continue the rule against // comments just
> as a matter of maintaining stylistic consistency. Code that's got a
> random mishmash of // and /* comments looks messy, if you ask me.
Coding styles are by definition a subjective area... Homogeneity
*whatever the precise but reasonable rules* in a code base is a good
thing.
> An alternative that would be worth considering is to adopt a uniform
> rule of // for line-ending comments and /* for all other uses.
Why not. As far as comments are concerned, editors usually highlight them
in some color, and my eyes get used to the comment color, so the simpler &
shorter the better, really.
> We'd have to teach pgindent about that, and I dunno how hard that is.
Maybe it is enough to just to turn "/* no-nl */" to "// no-nl" in
pgindent's post_indent, but probably I'm too naïve:-)
--
Fabien.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 20:49 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
@ 2016-10-24 21:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-10-25 00:37 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Tom Lane @ 2016-10-24 21:59 UTC (permalink / raw)
To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Michael Paquier <michael.paquier@gmail.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Fabien COELHO <coelho@cri.ensmp.fr> writes:
>> An alternative that would be worth considering is to adopt a uniform
>> rule of // for line-ending comments and /* for all other uses.
> Why not. As far as comments are concerned, editors usually highlight them
> in some color, and my eyes get used to the comment color, so the simpler &
> shorter the better, really.
>> We'd have to teach pgindent about that, and I dunno how hard that is.
> Maybe it is enough to just to turn "/* no-nl */" to "// no-nl" in
> pgindent's post_indent, but probably I'm too naïve:-)
Well, IMO the point of making that change would be to buy an additional
three characters of space for the comment before it wraps. So I'd suspect
that post-processing is too late. But I've not looked into pgindent to
see where the decisions are made exactly.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 20:49 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 21:59 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-10-25 00:37 ` Michael Paquier <michael.paquier@gmail.com>
2016-10-25 01:34 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2016-10-25 04:17 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 16+ messages in thread
From: Michael Paquier @ 2016-10-25 00:37 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@2ndquadrant.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
On Tue, Oct 25, 2016 at 6:59 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Fabien COELHO <coelho@cri.ensmp.fr> writes:
>>> An alternative that would be worth considering is to adopt a uniform
>>> rule of // for line-ending comments and /* for all other uses.
>
>> Why not. As far as comments are concerned, editors usually highlight them
>> in some color, and my eyes get used to the comment color, so the simpler &
>> shorter the better, really.
>
>>> We'd have to teach pgindent about that, and I dunno how hard that is.
>
>> Maybe it is enough to just to turn "/* no-nl */" to "// no-nl" in
>> pgindent's post_indent, but probably I'm too naïve:-)
>
> Well, IMO the point of making that change would be to buy an additional
> three characters of space for the comment before it wraps. So I'd suspect
> that post-processing is too late. But I've not looked into pgindent to
> see where the decisions are made exactly.
Well... Coming back to the subject, are there any recommendations from
committers? -std=c89 in CFLAGS does not seem to help much to detect
extra commas in enums, even if this has been added in C99.
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 20:49 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 21:59 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-25 00:37 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
@ 2016-10-25 01:34 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2016-10-25 01:44 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Thomas Munro <thomas.munro@enterprisedb.com>
1 sibling, 1 reply; 16+ messages in thread
From: Peter Eisentraut @ 2016-10-25 01:34 UTC (permalink / raw)
To: Michael Paquier <michael.paquier@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@2ndquadrant.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
On 10/24/16 8:37 PM, Michael Paquier wrote:
> Well... Coming back to the subject, are there any recommendations from
> committers? -std=c89 in CFLAGS does not seem to help much to detect
> extra commas in enums, even if this has been added in C99.
The only option that gives you a warning for this is -pedantic, and
that's not going to work because it disabled a bunch of other stuff.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 20:49 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 21:59 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-25 00:37 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-25 01:34 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
@ 2016-10-25 01:44 ` Thomas Munro <thomas.munro@enterprisedb.com>
0 siblings, 0 replies; 16+ messages in thread
From: Thomas Munro @ 2016-10-25 01:44 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: Michael Paquier <michael.paquier@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@2ndquadrant.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
On Tue, Oct 25, 2016 at 2:34 PM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 10/24/16 8:37 PM, Michael Paquier wrote:
>> Well... Coming back to the subject, are there any recommendations from
>> committers? -std=c89 in CFLAGS does not seem to help much to detect
>> extra commas in enums, even if this has been added in C99.
>
> The only option that gives you a warning for this is -pedantic, and
> that's not going to work because it disabled a bunch of other stuff.
Considering your work to make PostgreSQL a valid C++ program, I just
wanted to note that C++03 doesn't like trailing commas in enums (since
it incorporates the earlier C standard). That means that the baseline
for C++ would need to be at least C++11 for that to compile. There
are also C99 features that are not in any C++ standard including
variable length arrays (which the C++ people consider to be insane
AFAIK) and restrict.
--
Thomas Munro
http://www.enterprisedb.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 20:49 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 21:59 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-25 00:37 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
@ 2016-10-25 04:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-10-25 05:52 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
1 sibling, 1 reply; 16+ messages in thread
From: Tom Lane @ 2016-10-25 04:17 UTC (permalink / raw)
To: Michael Paquier <michael.paquier@gmail.com>; +Cc: Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@2ndquadrant.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Michael Paquier <michael.paquier@gmail.com> writes:
> Well... Coming back to the subject, are there any recommendations from
> committers? -std=c89 in CFLAGS does not seem to help much to detect
> extra commas in enums, even if this has been added in C99.
My opinion is don't worry about it. The buildfarm will find such problems
just fine, and there's no functional reason to stress about finding
extra commas before that.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 20:49 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 21:59 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
2016-10-25 00:37 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-25 04:17 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-10-25 05:52 ` Michael Paquier <michael.paquier@gmail.com>
0 siblings, 0 replies; 16+ messages in thread
From: Michael Paquier @ 2016-10-25 05:52 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Fabien COELHO <coelho@cri.ensmp.fr>; Alvaro Herrera <alvherre@2ndquadrant.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
On Tue, Oct 25, 2016 at 1:17 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Michael Paquier <michael.paquier@gmail.com> writes:
>> Well... Coming back to the subject, are there any recommendations from
>> committers? -std=c89 in CFLAGS does not seem to help much to detect
>> extra commas in enums, even if this has been added in C99.
>
> My opinion is don't worry about it. The buildfarm will find such problems
> just fine, and there's no functional reason to stress about finding
> extra commas before that.
Thanks for the feedback. Alea jacta est.
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Re: [COMMITTERS] pgsql: Remove extra comma at end of enum list Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2016-10-24 21:13 ` Fabien COELHO <coelho@cri.ensmp.fr>
1 sibling, 0 replies; 16+ messages in thread
From: Fabien COELHO @ 2016-10-24 21:13 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Michael Paquier <michael.paquier@gmail.com>; Magnus Hagander <magnus@hagander.net>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
>> I find it annoying that "//" comments are not supported, or having to
>> declare variables at the beginning of a block instead of when first used...
>
> I think some c99 features would be nice (variadic macros for one), but
> those particular two get a big "meh" from me.
This is probably a matter of taste.
The question really to know when some C99 features (inline, mixing code &
declarations, flexible array members, slash-slash comments, compound
literals, variadic macros, restrict qualifier, ...), will be considered
okay for Pg sources, or if they should be kept C89 compliant for the next
27 years.
Well, it seems that Microsoft took time to implement C99 features, which
would mean that a recent "Visual C++" would be required to compile pg on
windows if pg would use C99 features.
> .oO( I wonder if it'd be possible to make ereport() an inline function ... )
Probaby not: ISTM that ereport relies on the fact that it is a macro to
avoid evaluating some arguments until necessary, but the compiler would
not do that on a function, whether inlined or not, because it would change
the semantics if the evaluation was to fail.
--
Fabien.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 16+ messages in thread
end of thread, other threads:[~2016-10-25 05:52 UTC | newest]
Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-23 13:57 pgsql: Remove extra comma at end of enum list Magnus Hagander <magnus@hagander.net>
2016-10-24 04:51 ` Michael Paquier <michael.paquier@gmail.com>
2016-10-24 06:36 ` Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 18:31 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-10-24 19:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-10-24 19:11 ` Stephen Frost <sfrost@snowman.net>
2016-10-24 20:53 ` Petr Jelinek <petr@2ndquadrant.com>
2016-10-24 19:51 ` Bruce Momjian <bruce@momjian.us>
2016-10-24 20:49 ` Fabien COELHO <coelho@cri.ensmp.fr>
2016-10-24 21:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-10-25 00:37 ` Michael Paquier <michael.paquier@gmail.com>
2016-10-25 01:34 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2016-10-25 01:44 ` Thomas Munro <thomas.munro@enterprisedb.com>
2016-10-25 04:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-10-25 05:52 ` Michael Paquier <michael.paquier@gmail.com>
2016-10-24 21:13 ` Fabien COELHO <coelho@cri.ensmp.fr>
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