Re: pgsql: Fix declaration after statement

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Fix declaration after statement
Date: 2019-04-11 05:19:06
Message-ID: CA+hUKGKpHOGrj4LdY4DHvCFmk4TptV30JsNYiD2R2SzD=G_ckg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, Apr 11, 2019 at 5:05 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> > (My compiler does not complain about it, even though
> > -Wdeclaration-after-statement is specified. Weird.)
>
> longfin's compiler doesn't either (clang-1001.0.46.3).
> What are you using? Maybe we should be filing bug reports?

If you're filing a complaint, note that that's not a real clang
version number, that's Apple's unhelpful parallel version system.
clang 9 isn't out yet. According to [1], Apple clang "10.0.1" is
really upstream clang 7 (and Apple clang "10.0.0" is upstream clang 6,
despite deferring only in the "patch" component of the version). The
crazy thing is that it *almost* lines up with the Xcode version
numbers, but not quite.

I just tested clang 8 (FreeBSD 13 system compiler) and clang 9 (ports
llvm-devel, which tracks bleeding edge llvm head) and they both seem
to ignore -Wdeclaration-after-statement. GCC 8 warns for my test
program.

[1] https://en.wikipedia.org/wiki/Xcode#Latest_versions

--
Thomas Munro
https://enterprisedb.com

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Fabien COELHO 2019-04-11 07:03:19 Re: pgsql: Fix memory leak in pgbench
Previous Message Masahiko Sawada 2019-04-11 05:11:33 Re: pgsql: Fix memory leak in pgbench