Re: Compile warnings on OSX 10.10 clang 6.0 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Compile warnings on OSX 10.10 clang 6.0
Date
Msg-id 31316.1428159461@sss.pgh.pa.us
Whole thread Raw
In response to Re: Compile warnings on OSX 10.10 clang 6.0  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
> On Sat, Apr 4, 2015 at 6:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It occurred to me that maybe we could just turn off this class of warning,
>> and after some experimentation I found out that
>> "-Wno-unused-command-line-argument" does that, at least in the version
>> of clang that Apple's currently shipping.
>> 
>> Who's for enabling that if the compiler takes it?

> Yes, please. I always found those pthread warnings annoying.

After a bit more experimentation I found out that for both gcc and clang
(at least in the versions I'm using, on RHEL6 and Yosemite), you can
write "-Wno-anythingatall" and the compiler will not complain about it.
(And how did *that* get by the bozo who put in this warning, I wonder.)
So that means that if we just add the obvious test
 PGAC_PROG_CC_CFLAGS_OPT([-Wno-unused-command-line-argument])

then we will end up including that in CFLAGS on pretty much every
platform, whether or not there's an actual problem to solve.

gcc *does* complain about -Wunused-command-line-argument, so a possible
answer is to test for that and then add the other to CFLAGS.  That seems
kinda grotty though, does anyone have another way?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: TABLESAMPLE patch
Next
From: sudalai
Date:
Subject: File count restriction of directory limits number of relations inside a database.