← Back to team overview

kicad-developers team mailing list archive

Re: compile warnings about copying loop variable

 

That's fun!  New warning flags.  Those are from -Wrange-loop-analysis that
is specific to clang.  Those of us using gcc won't see them.

They are suggesting minor improvements.  You should feel free to submit a
MR to correct these cases or you can set your flags to
-Wno-range-loop-analysis to disable them.

Best-
Seth

On Wed, Mar 10, 2021 at 5:26 AM Jonatan Liljedahl <lijon@xxxxxxxxxxxx>
wrote:

> I get a lot of compile warnings like this:
>
> In file included from /Users/lijon/Coding/kicad/include/dialog_shim.h:29:
> /Users/lijon/Coding/kicad/include/hashtables.h:87:26: warning: loop
> variable 'c' is always a copy because the range of type 'const
> wxString' does not return a reference
>       [-Wrange-loop-analysis]
>         for( const auto& c : aString )
>                          ^
> /Users/lijon/Coding/kicad/include/hashtables.h:87:14: note: use
> non-reference type 'wxUniChar'
>         for( const auto& c : aString )
>              ^~~~~~~~~~~~~~~
>
>
> --
> /Jonatan
> http://kymatica.com
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>


-- 
[image: KiCad Services Corporation Logo]
Seth Hillbrand
*Lead Developer*
+1-530-302-5483‬
Long Beach, CA
www.kipro-pcb.com    info@xxxxxxxxxxxxx

Follow ups

References