← Back to team overview

kicad-developers team mailing list archive

Re: PATCH: 3D resolver

 

Hi Wayne,

 Yes, that's a c++11 thing:  std::list<T>::insert( position,
list_initializer ).
Since we now enforce the c++11 build flag for GNU + clang I started
to use c++11 syntax where I could. If others agree to still support these
old systems I can always go through and change c++11 syntax to c++98
where applicable.

- Cirilo

On Tue, May 3, 2016 at 1:40 AM, Wayne Stambaugh <stambaughw@xxxxxxxxx>
wrote:

> Cirilo,
>
> I'm getting the following build error on the old MinGW32/MSYS1 build
> platform on windows using gcc 4.7.3 with your patch.  It looks like you
> are using an invalid list insert call.  I'm guessing this is a C++ 0x11
> feature.
>
> Headers are up-to-date
> c:/src/kicad/product/3d-viewer/3d_cache/3d_filename_resolver.cpp: In
> member function 'void S3D_FILENAME_RESOLVER::checkEnvVarPath(const
> wxString&)':
> c:/src/kicad/product/3d-viewer/3d_cache/3d_filename_resolver.cpp:845:32:
> error: no matching function for call to
> 'std::list<S3D_ALIAS>::insert(std::list<S3D_ALIAS>::const_iterator&,
> S3D_ALIAS&)'
> c:/src/kicad/product/3d-viewer/3d_cache/3d_filename_resolver.cpp:845:32:
> note: candidates are:
> In file included from
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/list:65:0,
>                  from
> c:/src/kicad/product/3d-viewer/3d_cache/3d_filename_resolver.h:36,
>                  from
> c:/src/kicad/product/3d-viewer/3d_cache/3d_filename_resolver.cpp:34:
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/list.tcc:99:5:
> note: std::list<_Tp, _Alloc>::iterator std::list<_Tp,
> _Alloc>::insert(std::list<_Tp, _Alloc>::iterator, const value_type&)
> [with _Tp = S3D_ALIAS; _Alloc = std::allocator<S3D_ALIAS>;
> std::list<_Tp, _Alloc>::iterator = std::_List_iterator<S3D_ALIAS>;
> std::list<_Tp, _Alloc>::value_type = S3D_ALIAS]
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/list.tcc:99:5:
> note:   no known conversion for argument 1 from
> 'std::list<S3D_ALIAS>::const_iterator {aka
> std::_List_const_iterator<S3D_ALIAS>}' to
> 'std::list<S3D_ALIAS>::iterator {aka std::_List_iterator<S3D_ALIAS>}'
> In file included from
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/list:64:0,
>                  from
> c:/src/kicad/product/3d-viewer/3d_cache/3d_filename_resolver.h:36,
>                  from
> c:/src/kicad/product/3d-viewer/3d_cache/3d_filename_resolver.cpp:34:
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_list.h:1070:7:
> note: std::list<_Tp, _Alloc>::iterator std::list<_Tp,
> _Alloc>::insert(std::list<_Tp, _Alloc>::iterator, std::list<_Tp,
> _Alloc>::value_type&&) [with _Tp = S3D_ALIAS; _Alloc =
> std::allocator<S3D_ALIAS>; std::list<_Tp, _Alloc>::iterator =
> std::_List_iterator<S3D_ALIAS>; std::list<_Tp, _Alloc>::value_type =
> S3D_ALIAS]
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_list.h:1070:7:
> note:   no known conversion for argument 1 from
> 'std::list<S3D_ALIAS>::const_iterator {aka
> std::_List_const_iterator<S3D_ALIAS>}' to
> 'std::list<S3D_ALIAS>::iterator {aka std::_List_iterator<S3D_ALIAS>}'
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_list.h:1087:7:
> note: void std::list<_Tp, _Alloc>::insert(std::list<_Tp,
> _Alloc>::iterator, std::initializer_list<_Tp>) [with _Tp = S3D_ALIAS;
> _Alloc = std::allocator<S3D_ALIAS>; std::list<_Tp, _Alloc>::iterator =
> std::_List_iterator<S3D_ALIAS>]
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_list.h:1087:7:
> note:   no known conversion for argument 1 from
> 'std::list<S3D_ALIAS>::const_iterator {aka
> std::_List_const_iterator<S3D_ALIAS>}' to
> 'std::list<S3D_ALIAS>::iterator {aka std::_List_iterator<S3D_ALIAS>}'
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_list.h:1104:7:
> note: void std::list<_Tp, _Alloc>::insert(std::list<_Tp,
> _Alloc>::iterator, std::list<_Tp, _Alloc>::size_type, const value_type&)
> [with _Tp = S3D_ALIAS; _Alloc = std::allocator<S3D_ALIAS>;
> std::list<_Tp, _Alloc>::iterator = std::_List_iterator<S3D_ALIAS>;
> std::list<_Tp, _Alloc>::size_type = unsigned int; std::list<_Tp,
> _Alloc>::value_type = S3D_ALIAS]
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_list.h:1104:7:
> note:   candidate expects 3 arguments, 2 provided
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_list.h:1125:9:
> note: template<class _InputIterator> void
> std::list::insert(std::list<_Tp, _Alloc>::iterator, _InputIterator,
> _InputIterator) [with _InputIterator = _InputIterator; _Tp = S3D_ALIAS;
> _Alloc = std::allocator<S3D_ALIAS>]
> c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/bits/stl_list.h:1125:9:
> note:   template argument deduction/substitution failed:
> c:/src/kicad/product/3d-viewer/3d_cache/3d_filename_resolver.cpp:845:32:
> note:   cannot convert 'sPL' (type 'std::list<S3D_ALIAS>::const_iterator
> {aka std::_List_const_iterator<S3D_ALIAS>}') to type
> 'std::list<S3D_ALIAS>::iterator {aka std::_List_iterator<S3D_ALIAS>}'
> make[2]: ***
> [3d-viewer/CMakeFiles/3d-viewer.dir/3d_cache/3d_filename_resolver.cpp.obj]
> Error 1
> make[1]: *** [3d-viewer/CMakeFiles/3d-viewer.dir/all] Error 2
> make: *** [all] Error 2
>
> I'm not 100% sure we should pull the plug on mingw32/msys1 just yet.
> There will most likely be a bunch ubuntu and fedora users who are using
> older stable versions that this will effect as well.  Personally I'm
> fine with dumping these older platforms but our users may not feel the
> same way.  Anyone else have any thoughts about this?
>
> On 4/24/2016 2:06 AM, Cirilo Bernardo wrote:
> > The attached patch fixes a cut/paste syntactic error present
> > in all previous patches. A do{} block was changed to if{} but
> > the while() expression at the end was not removed.
> >
> > - Cirilo
> >
> >
> > On Sun, Apr 24, 2016 at 9:06 AM, Cirilo Bernardo
> > <cirilo.bernardo@xxxxxxxxx <mailto:cirilo.bernardo@xxxxxxxxx>> wrote:
> >
> >     The attached revised patch (against r6710) adds support for
> $(ENV_VAR)
> >     and fixes the bug reported by easyw: "invalid filename" on MSWin when
> >     manually editing a file name containing ${ENV_VAR}.
> >
> >     - Cirilo
> >
> >
> >     On Sat, Apr 23, 2016 at 5:29 PM, jp charras <jp.charras@xxxxxxxxxx
> >     <mailto:jp.charras@xxxxxxxxxx>> wrote:
> >
> >         Le 23/04/2016 09:16, Cirilo Bernardo a écrit :
> >         > Thanks Jean-Pierre,  I'll go through the 3D model code and
> make sure it can
> >         > use "${" and "$(".  I'm not sure about "%{", "%(" though since
> that wouldn't
> >         > be portable.  In principle there can also be multiple
> substitutions and a
> >         > substitution in the middle of a string such as
> >         > "/path/${VAR1}/${VAR2}/model.wrl"
> >         > but I think the current system should work fine; if people do
> something else
> >         > they can be responsible for the resulting behavior.
> >         >
> >         > - Cirilo
> >
> >         Supporting both "${" and "$(" is enough for me.
> >         If "${" is the starting point, "}" is the end of var name, and
> >         for "$(" the end of var name is ")"
> >
> >
> >         >
> >         > On Sat, Apr 23, 2016 at 4:28 PM, jp charras
> >         <jp.charras@xxxxxxxxxx <mailto:jp.charras@xxxxxxxxxx>> wrote:
> >         >
> >         >> Le 23/04/2016 01:29, Cirilo Bernardo a écrit :
> >         >>> Hi Wayne,
> >         >>>
> >         >>>  The attached patch was made against r6709.
> >         >>>
> >         >>> - Cirilo
> >         >>
> >         >> Cirilo, I just had a look at the patch, and noticed a (minor)
> >         issue:
> >         >> you are searching an ENV VAR by searching "${"
> >         >>
> >         >> This is perfectly true, but incomplete.
> >         >> wxWidgets accepts both "${" and "$(". (and on windows accept
> >         also "%{" and
> >         >> "%(" and more)
> >         >> The delimiters can be { and } or ( and )
> >         >> They are equivalent in wxWidgets, and allows using ) or } in
> >         paths
> >         >>
> >         >> (have a look at wxString wxExpandEnvVars(const wxString& str)
> in
> >         >> src/common/config.cpp, perhaps it
> >         >> could be used )
> >         >>
> >         >>
> >         >> This in important because we are using both in Kicad.
> >         >> for instance the fp lib wizard uses $(xxx) and in docs we use
> >         ${xxx}
> >         >> notation
> >         >>
> >         >> Thanks.
> >         >>
> >         >>>
> >         >>>
> >         >>> On Sat, Apr 23, 2016 at 12:52 AM, Wayne Stambaugh
> >         <stambaughw@xxxxxxxxx <mailto:stambaughw@xxxxxxxxx>>
> >         >>> wrote:
> >         >>>
> >         >>>> Cirilo,
> >         >>>>
> >         >>>> This patch no longer applies cleanly.  Would you please fix
> >         it an repost
> >         >>>> it.
> >         >>>>
> >         >>>> Thanks,
> >         >>>>
> >         >>>> Wayne
> >         >>>>
> >         >>
> >         >>
> >         >> --
> >         >> Jean-Pierre CHARRAS
> >         >>
> >         >> _______________________________________________
> >         >> Mailing list: https://launchpad.net/~kicad-developers
> >         >> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >         <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >         >> Unsubscribe : https://launchpad.net/~kicad-developers
> >         >> More help   : https://help.launchpad.net/ListHelp
> >         >>
> >         >
> >
> >
> >         --
> >         Jean-Pierre CHARRAS
> >
> >
> >
> >
> >
> > _______________________________________________
> > 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
> >
>
> _______________________________________________
> 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
>

References