Re: /bzr/squid3/trunk/ r12903: Instruct clang not to treat unused command line arguments as errors

From: Kinkie <gkinkie_at_gmail.com>
Date: Mon, 10 Jun 2013 14:59:10 +0200

On Mon, Jun 10, 2013 at 11:27 AM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
> On 10/06/2013 8:35 a.m., Francesco Chemolli wrote:
>>
>> ------------------------------------------------------------
>> revno: 12903
>> committer: Francesco Chemolli <kinkie_at_squid-cache.org>
>> branch nick: trunk
>> timestamp: Sun 2013-06-09 22:35:58 +0200
>> message:
>> Instruct clang not to treat unused command line arguments as errors
>> modified:
>> acinclude/compiler-flags.m4
>
>
> Anyone known why we have the "-Wno-error=parentheses-equality" option in teh
> first place?
> It would seem to me to be one of the warnings highlighting a coding
> guideline violation we need to fix in the sources. Not something to be
> suppressed.

I do, as I added it:

in case of
if (bool foo = somefunction()) {
}

gcc -Werror barfs unless it's expressed as:
if ((bool foo = somefunction())) {
}

while clang -Werror barfs for the unneeded parentheses, at least for
some clang versions
That option makes clang accept the GCC-ism.
The portable solution would probably be a macro:
stuff like:
if (MAYBE_PARENTHESIZE(bool foo = somefunction()) {
}

That'd be a readability FAIL.

--
    /kinkie
Received on Mon Jun 10 2013 - 12:59:21 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 10 2013 - 12:00:22 MDT