Re: [code] PATCH: Silence some compilation warnings; lspawn.c

From: Markus F.X.J. Oberhumer <markus.att.oberhumer.com>
Date: Thu, 18 Aug 2016 17:46:52 +0200

It's always worthwhile to compile on high warning levels like "-Wall -Wextra -Werror",
but it needs some efforts to clean up existing code - but then these are usually
just trivial patches.

For example, just yesterday my clang-3.8 build has spotted this obvious bug in tre:

tre/lib/tre-match-backtrack.c:603:42: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
              if (stack->item.state->assertions && ASSERT_BACKREF)
                                                ^ ~~~~~~~~~~~~~~
tre/lib/tre-match-backtrack.c:603:42: note: use '&' for a bitwise operation
              if (stack->item.state->assertions && ASSERT_BACKREF)
                                                ^~ &
src/tre/lib/tre-match-backtrack.c:603:42: note: remove constant to silence this warning
              if (stack->item.state->assertions && ASSERT_BACKREF)
                                               ~^~~~~~~~~~~~~~~~~
1 error generated.

Cheers,
Markus

On 2016-08-18 15:59, Mitchell wrote:
> Hi Markus,
>
> On Wed, 17 Aug 2016, Markus F.X.J. Oberhumer wrote:
>
>> Hi Mitchell,
>>
>> I'm currently working on a cmake build system for textadept where I use
>> high compiler warning levels by default, and as a result I have a number of
>> other trivial and NFC (No Functional Changes) patches.
>>
>> Still - as preparing such patches requires some work - I'd like to know
>> if you are actually interested into such contributions.
>
> What do you mean by "high compiler warning levels"? Can you give an example? I
> think the only warnings I'm not interested in fixing are unused variables, but
> I'm not 100% certain. I just know that I've defined warning flags in the
> Make-based build system such that I don't get warnings when I compile with GCC
> 4.6 on Linux (there may be warnings on other platforms that I'm not aware of
> though).
>
> Cheers,
> Mitchell

-- 
Markus Oberhumer, <markus@oberhumer.com>, http://www.oberhumer.com/
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 18 Aug 2016 - 11:46:52 EDT

This archive was generated by hypermail 2.2.0 : Fri 19 Aug 2016 - 06:44:11 EDT