Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-12 Thread Ian McInerney
> >> >> <mailto:kicad-developers-bounces+bevan.weiss= > gmail@lists.launchpad.net>> *On > >> Behalf Of *Ian McInerney > >> *Sent:* 12 January 2020 12:24 > >> *To:* Jeff Young mailto:j...@rokeby.ie>> > >> *Cc:* KiCad Developers >

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-12 Thread Wayne Stambaugh
ail@lists.launchpad.net>>  >> *On >> Behalf Of *Ian McInerney >> *Sent:* 12 January 2020 12:24 >> *To:* Jeff Young mailto:j...@rokeby.ie>> >> *Cc:* KiCad Developers > <mailto:kicad-developers@lists.launchpad.net>> >> *Subject:* Re: [Kicad-devel

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-12 Thread Jeff Young
pers > On > Behalf Of Ian McInerney > Sent: 12 January 2020 12:24 > To: Jeff Young > Cc: KiCad Developers > Subject: Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets > > I thought that Wayne was agreeing with requiring them on all lengths of > stateme

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread Bevan Weiss
2020 12:24 To: Jeff Young Cc: KiCad Developers Subject: Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets I thought that Wayne was agreeing with requiring them on all lengths of statements (single line). Although, now that I look at the code closer, I don't know

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread Ian McInerney
I thought that Wayne was agreeing with requiring them on all lengths of statements (single line). Although, now that I look at the code closer, I don't know if this is as dire a problem. While it is a macro, it is defined like this: #define wxLogTrace \ if (

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread Jeff Young
We could also just require them on if/then/else statements…. > On 12 Jan 2020, at 00:35, Jeff Young wrote: > > Sure, but unless we go with Seth’s option, then it’s just going to happen > again…. > >> On 11 Jan 2020, at 23:28, Wayne Stambaugh > > wrote: >> >> I

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread Jeff Young
Sure, but unless we go with Seth’s option, then it’s just going to happen again…. > On 11 Jan 2020, at 23:28, Wayne Stambaugh wrote: > > I agree that adding the curly brackets would be the best option as well. > It's less than ideal but it resolves the issue. > > On 1/11/20 6:21 PM, Ian

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread Wayne Stambaugh
I agree that adding the curly brackets would be the best option as well. It's less than ideal but it resolves the issue. On 1/11/20 6:21 PM, Ian McInerney wrote: > That is probably the best option, since many things in wxWidgets are > implemented as macros but masquerade as functions. > > -Ian

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread Ian McInerney
That is probably the best option, since many things in wxWidgets are implemented as macros but masquerade as functions. -Ian On Sat, Jan 11, 2020 at 10:07 PM wrote: > I suppose that we could update our coding policy to require braces even > for single line statements. > > -Seth > > On Jan 11,

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread seth
I suppose that we could update our coding policy to require braces even for single line statements.-SethOn Jan 11, 2020 1:28 PM, Jeff Young wrote:This looks safe enough:if( n_changed )wxLogTrace( "CN", "Cluster %p : net : %d %s\n", cluster.get(),cluster->OriginNet(), (const char*)

Re: [Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread Ian McInerney
In this case we should just need to clarify the scope (which I just pushed a fix doing). In general... I am not as sure about. -Ian On Sat, Jan 11, 2020 at 9:28 PM Jeff Young wrote: > This looks safe enough: > > if( n_changed ) > wxLogTrace( "CN", "Cluster %p : net : %d %s\n",

[Kicad-developers] Coverity finds an ugly bug in wxWidgets

2020-01-11 Thread Jeff Young
This looks safe enough: if( n_changed ) wxLogTrace( "CN", "Cluster %p : net : %d %s\n", cluster.get(), cluster->OriginNet(), (const char*) cluster->OriginNetName().c_str() ); else wxLogTrace( "CN", "Cluster %p : nothing to propagate\n", cluster.get() ); Sadly, the macro