Обсуждение: Obsolete TODO item "-Wcast-align" ?

Поиск
Список
Период
Сортировка

Obsolete TODO item "-Wcast-align" ?

От
Christian Convey
Дата:
Hi guys,

I'm trying to get my feet wet in PG development, but I ran into a snag
with the TODO item I picked.  Could someone please tell me if I'm
making an obvious error?

I chose this item from the TODO page: "[E] Remove warnings created by
-Wcast-align".  It didn't have a check-mark after the "[E]", which I
took to mean it's an outstanding issue.

However, I'm starting to wonder if it's already been fixed:

(1) I wasn't able to reproduce it.  I built PG using:    * PG source commit 6591f4...  (a recent master/HEAD)    *
Ubuntu'spatched version of GCC 4.8.4    * "-Wcast-align"
 
but I didn't see anything in the compiler output indicating that the
warning got triggered.

(2) It looks like someone else tried to tackle this TODO item about
two years ago, but he also was unable to reproduce it:

https://www.postgresql.org/message-id/flat/CALgh3eseTDT9RspDi0AfhE0j0A3e%2B5XiS3ykQyhK7Z5RgPQTLA%40mail.gmail.com#CALgh3eseTDT9RspDi0AfhE0j0A3e+5XiS3ykQyhK7Z5RgPQTLA@mail.gmail.com

I didn't find any other discussions about that line-item via Google,
or by looking at the official/unofficial TODO-detail pages.

Thanks very much,
Christian Convey



Re: Obsolete TODO item "-Wcast-align" ?

От
Tom Lane
Дата:
Christian Convey <christian.convey@gmail.com> writes:
> I chose this item from the TODO page: "[E] Remove warnings created by
> -Wcast-align".  It didn't have a check-mark after the "[E]", which I
> took to mean it's an outstanding issue.
> However, I'm starting to wonder if it's already been fixed:

No, but you only see it on some platforms/compilers.  On my OS X laptop
(clang-based not gcc-based compiler), turning that on generates just a
hair short of 13000 warnings :-(

I think that TODO item is indeed obsolete, but more in the direction
of "we're never gonna do that".  There are too many places where we
do need to cast up from generic pointer to specific structure pointer,
and there doesn't seem to be any practical way to tell a compiler which
instances are useful to warn about.
        regards, tom lane



Re: Obsolete TODO item "-Wcast-align" ?

От
Christian Convey
Дата:
On Sun, Sep 4, 2016 at 5:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Christian Convey <christian.convey@gmail.com> writes:
>> I chose this item from the TODO page: "[E] Remove warnings created by
>> -Wcast-align".  It didn't have a check-mark after the "[E]", which I
>> took to mean it's an outstanding issue.
>> However, I'm starting to wonder if it's already been fixed:
>
> No, but you only see it on some platforms/compilers.  On my OS X laptop
> (clang-based not gcc-based compiler), turning that on generates just a
> hair short of 13000 warnings :-(
>
> I think that TODO item is indeed obsolete, but more in the direction
> of "we're never gonna do that".  There are too many places where we
> do need to cast up from generic pointer to specific structure pointer,
> and there doesn't seem to be any practical way to tell a compiler which
> instances are useful to warn about.

Thanks for the response.  I'm unclear about how the TODO list is
curated.  Is there someone whose attention I should direct to this
thread?

- Christian



Re: Obsolete TODO item "-Wcast-align" ?

От
Bruce Momjian
Дата:
On Sun, Sep  4, 2016 at 06:10:23PM -0400, Christian Convey wrote:
> On Sun, Sep 4, 2016 at 5:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Christian Convey <christian.convey@gmail.com> writes:
> >> I chose this item from the TODO page: "[E] Remove warnings created by
> >> -Wcast-align".  It didn't have a check-mark after the "[E]", which I
> >> took to mean it's an outstanding issue.
> >> However, I'm starting to wonder if it's already been fixed:
> >
> > No, but you only see it on some platforms/compilers.  On my OS X laptop
> > (clang-based not gcc-based compiler), turning that on generates just a
> > hair short of 13000 warnings :-(
> >
> > I think that TODO item is indeed obsolete, but more in the direction
> > of "we're never gonna do that".  There are too many places where we
> > do need to cast up from generic pointer to specific structure pointer,
> > and there doesn't seem to be any practical way to tell a compiler which
> > instances are useful to warn about.
> 
> Thanks for the response.  I'm unclear about how the TODO list is
> curated.  Is there someone whose attention I should direct to this
> thread?

Someone has removed the item.  It is a wiki so anyone can add/remove
things.

--  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 +



Re: Obsolete TODO item "-Wcast-align" ?

От
Jim Nasby
Дата:
On 9/4/16 5:10 PM, Christian Convey wrote:
> Thanks for the response.  I'm unclear about how the TODO list is
> curated.  Is there someone whose attention I should direct to this
> thread?

There's a number of people that can edit the TODO list. I've removed 
that item.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461