添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
精明的蘑菇  ·  媒介实验室·  3 月前    · 
聪明的大脸猫  ·  Aqara ...·  3 月前    · 
豪情万千的柿子  ·  GitHub - ...·  4 月前    · 
I've been getting -Wdeprecated-declarations for some time now, for example the following.

Code: Select all

In file included from /usr/include/opencascade/NCollection_IndexedDataMap.hxx:23,
                 from /usr/include/opencascade/Standard_Dump.hxx:17,
                 from /usr/include/opencascade/NCollection_Vec2.hxx:20,
                 from /usr/include/opencascade/NCollection_Vec3.hxx:20,
                 from /usr/include/opencascade/NCollection_Vec4.hxx:18,
                 from /usr/include/opencascade/NCollection_Mat4.hxx:19,
                 from /usr/include/opencascade/gp_Trsf.hxx:21,
                 from /usr/include/opencascade/gp_Trsf2d.lxx:15,
                 from /usr/include/opencascade/gp_Trsf2d.hxx:244,
                 from /usr/include/opencascade/gp_Dir2d.lxx:21,
                 from /usr/include/opencascade/gp_Dir2d.hxx:274,
                 from /usr/include/opencascade/gp_Vec2d.lxx:18,
                 from /usr/include/opencascade/gp_Vec2d.hxx:318,
                 from /usr/include/opencascade/gp_Pnt2d.lxx:19,
                 from /usr/include/opencascade/gp_Pnt2d.hxx:175,
                 from /usr/include/opencascade/TColgp_HArray1OfPnt2d.hxx:20,
                 from /usr/include/opencascade/Geom2d_BSplineCurve.hxx:28,
                 from /.../src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp:25:
/usr/include/opencascade/NCollection_StlIterator.hxx:30:15: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations]
   30 |   public std::iterator<Category, ItemType, ptrdiff_t,
      |               ^~~~~~~~
In file included from /usr/include/c++/12.1.0/bits/stl_algobase.h:65,
                 from /usr/include/c++/12.1.0/bits/specfun.h:45,
                 from /usr/include/c++/12.1.0/cmath:1935,
                 from /usr/include/opencascade/Standard_Real.hxx:18,
                 from /usr/include/opencascade/Standard_PrimitiveTypes.hxx:25,
                 from /usr/include/opencascade/Standard_Transient.hxx:20,
                 from /usr/include/opencascade/Standard.hxx:91,
                 from /usr/include/opencascade/Geom2d_BSplineCurve.hxx:20:
/usr/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
Anyone has an idea what's happening and what can be done about it? I suspect updating OCC might help, but I don't see a newer version on Manjaro and I'd prefer not to compile OCCT just for this purpose.
Some of the std::iterator classes cannot be used as sub-class for own iterator implementations any more. To solve the warnings all what needs to be done is to define the types iterator_category , value_type , difference_type , pointer and reference . I once did this for the PyCXX sources ( git commit 4547e989e ).
wmayer wrote: Sat Jul 30, 2022 3:05 pm Some of the std::iterator classes cannot be used as sub-class for own iterator implementations any more. To solve the warnings all what needs to be done is to define the types iterator_category , value_type , difference_type , pointer and reference . I once did this for the PyCXX sources ( git commit 4547e989e ). Is this supposed to be done in stl_algobase and OCC then? I am not able to see where else I could do this within the freecad code.
Is this supposed to be done in stl_algobase and OCC then? I am not able to see where else I could do this within the freecad code.
It must be done in the OCC sources. The warning is raised because some custom iterator classes are derived from the deprecated classes.
To fix the warning one has to add a few public typedefs to the custom iterator class. But because OCC headers cause the warning it's best to report a bug in the OCC tracker.
wmayer wrote: Mon Nov 07, 2022 3:17 pm
Is this supposed to be done in stl_algobase and OCC then? I am not able to see where else I could do this within the freecad code.
It must be done in the OCC sources. Probably also in whatever package provides /usr/include/c++/12.1.0/bits/stl_algobase.h . But for now it's not in our control so I guess I'm just gonna have to suppress the warnings.
Probably also in whatever package provides /usr/include/c++/12.1.0/bits/stl_algobase.h. But for now it's not in our control so I guess I'm just gonna have to suppress the warnings.
I can hardly imagine that the STL implementation deprecates a feature in one part and uses this feature in another part of it.
wmayer wrote: Mon Nov 07, 2022 7:48 pm
Probably also in whatever package provides /usr/include/c++/12.1.0/bits/stl_algobase.h. But for now it's not in our control so I guess I'm just gonna have to suppress the warnings.
I can hardly imagine that the STL implementation deprecates a feature in one part and uses this feature in another part of it. You're right. Reading more carefully I see that it just says that is where the "std::iterator" class was declared. This is all OCC.