]> OCCT Git - occt.git/commitdiff
Coding - GCC13 warning suppressing #96
authordpasukhi <dpasukhi@opencascade.com>
Sat, 12 Oct 2024 16:26:32 +0000 (16:26 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Sat, 12 Oct 2024 16:26:32 +0000 (16:26 +0000)
.github/workflows/build-linux-gcc-x64-dynamic.yml
src/BRepTest/BRepTest_BasicCommands.cxx
src/MeshTest/MeshTest.cxx
src/QANCollection/QANCollection_Handle.cxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx

index d23643ccb55d3d66a3b74bf29c7c3f13623d01c1..14b2d1450fd99a175aa5ecc107db06b14e4fd43e 100644 (file)
@@ -33,8 +33,8 @@ jobs:
               -D CMAKE_CXX_COMPILER=g++ \
               -D USE_FREETYPE=OFF \
               -D CMAKE_BUILD_TYPE=Release \
-              -D CMAKE_C_FLAGS="-Werror" \
-              -D CMAKE_CXX_FLAGS="-Werror" ..
+              -D CMAKE_C_FLAGS="-Werror -Wno-clobbered -Wmaybe-uninitialized -Wodr -Wno-alloc-size-larger-than" \
+              -D CMAKE_CXX_FLAGS="-Werror -Wno-clobbered -Wno-dangling-pointer" ..
 
     - name: Build OCCT
       run: |
index 76019fd643fda93afade416f2d7cab12434be485..ad81d7bc9032da9a427f77f2e42d913b3ff15c9e 100644 (file)
@@ -961,7 +961,7 @@ static Standard_Integer findplane(Draw_Interpretor& di,Standard_Integer n,const
   if (a_plane_finder.Found()) {
     //std::cout << " a plane is found "   ;
     di << " a plane is found \n";
-    const Handle(Geom_Geometry)& aSurf = a_plane_finder.Plane(); // to avoid ambiguity
+    const Handle(Geom_Geometry) aSurf = a_plane_finder.Plane(); // to avoid ambiguity
     DrawTrSurf::Set(a[2],aSurf) ;
   }
   return 0 ;
index 02f2997487f3f9dd18e1e07bd892c55e6bb58209..731a18653c3007ecce9d9ac92cfa2c2e9694b4f7 100644 (file)
@@ -1042,9 +1042,9 @@ static Standard_Integer veriftriangles(Draw_Interpretor& di, Standard_Integer n,
         else 
           T->Triangle (i).Get (n1,n2,n3);
 
-        const gp_XY& xy1 = T->UVNode (n1).XY();
-        const gp_XY& xy2 = T->UVNode (n2).XY();
-        const gp_XY& xy3 = T->UVNode (n3).XY();
+        const gp_Pnt2d xy1 = T->UVNode (n1);
+        const gp_Pnt2d xy2 = T->UVNode (n2);
+        const gp_Pnt2d xy3 = T->UVNode (n3);
 
         mi2d1.SetCoord((xy2.X()+xy3.X())*0.5, 
           (xy2.Y()+xy3.Y())*0.5);
index 89c593e63dd750ab6f9feef1bd388b0cc5cc12bc..5ebadba24d96be7d2424e20d215f2831df7bb9b5 100644 (file)
@@ -135,8 +135,15 @@ static Standard_Integer QAHandleOps (Draw_Interpretor& theDI,
   // compiler does not keep temporary object referenced by local variable of base type;
   // here compiler does not recognize that it should keep the temporary object because handle
   // classes do not inherit each other and they use hard cast for references to simulate inheritance
+#if defined(__GNUC__) && (__GNUC__ > 12)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdangling-reference"
+#endif
   const Handle(Geom_Curve)& aTmpRefBase (Handle(Geom_Line)::DownCast (aCurve2));
   CHECK(theDI, aTmpRefBase.get() != aCurve2.get(),  "local reference to temporary handle object (base type)");
+#if defined(__GNUC__) && (__GNUC__ > 12)
+#pragma GCC diagnostic pop
+#endif
 
   // check operations with Handle_* classes
   Handle(Geom_Line) hLine = aLine;
@@ -174,11 +181,18 @@ static Standard_Integer QAHandleOps (Draw_Interpretor& theDI,
   Handle_Geom_Line qhLine = cpLine; // constructor from const pointer -- could be made explicit...
 
   // check that compiler keeps temporary object referenced by local variable
+#if defined(__GNUC__) && (__GNUC__ > 12)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdangling-reference"
+#endif
   const Handle_Geom_Line& hTmpRef (Handle(Geom_Line)::DownCast (aCurve2));
   CHECK(theDI, hTmpRef.get() == aCurve2.get(),  "local reference to temporary object (Handle_)");
 
   // check lifetime of temporary object referenced by local variable (base type)
   const Handle_Geom_Curve& hTmpRefBase (Handle(Geom_Line)::DownCast (aCurve2));
+  #if defined(__GNUC__) && (__GNUC__ > 11)
+#pragma GCC diagnostic pop
+#endif
   // here we have different behavior for MSVC 2013+ where Handle_ is a class
   // (compiler creates temporary object of approprtiate type and keeps it living
   // until the reference is valid) and other compilers where Handle_ is
index dd9eef42fb5f8cbcf7f5eb2d60caa55a92a61a85..2034d02dedec6c024decb4c077f3b2393e92fa99 100644 (file)
@@ -1303,7 +1303,7 @@ static Standard_Boolean IsOverriden(const Interface_Graph& theGraph,
         return Standard_True;
       }
       // for root style returns true only if it is overridden by other root style
-      const Handle(Standard_Transient)& anItem = anOverRidingStyle->ItemAP242().Value();
+      const Handle(Standard_Transient) anItem = anOverRidingStyle->ItemAP242().Value();
       if(!anItem.IsNull() && anItem->IsKind(STANDARD_TYPE(StepShape_ShapeRepresentation)))
       {
         return Standard_True;
index d1f6ca0f997e008479b4b315746edd0e80d45bfb..8042556fc472dc1b86c0b8c8125492bf42572655 100644 (file)
@@ -678,7 +678,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
     Handle(TopOpeBRepBuild_Pave) PV = new TopOpeBRepBuild_Pave(VPV,par,vofe);
     if (hasVSD) {
       PV->HasSameDomain(Standard_True);
-      const TopoDS_Shape& VSD = myDataStructure->SameDomain(VPV).Value();
+      const TopoDS_Shape& VSD = myDataStructure->DS().ShapeSameDomain(VPV).First();
       Standard_Integer iVSD = myDataStructure->Shape(VSD);
       if (iVSD == iVRE) PV->SameDomain(VIG);
       else              PV->SameDomain(VSD);
@@ -712,7 +712,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
     Handle(TopOpeBRepBuild_Pave) PVF = new TopOpeBRepBuild_Pave(VPV,parf,vfofe);
     if (hasVSD) {
       PVF->HasSameDomain(Standard_True);
-      const TopoDS_Shape& VSD = myDataStructure->SameDomain(VPV).Value();
+      const TopoDS_Shape& VSD = myDataStructure->DS().ShapeSameDomain(VPV).First();
       Standard_Integer iVSD = myDataStructure->Shape(VSD);
       if (iVSD == iVRE) PVF->SameDomain(VIG);
       else              PVF->SameDomain(VSD);
@@ -733,7 +733,7 @@ void TopOpeBRepBuild_Builder::GFillPointTopologyPVS(const TopoDS_Shape& E,
     Handle(TopOpeBRepBuild_Pave) PVR = new TopOpeBRepBuild_Pave(VPV,parl,vrofe);
     if (hasVSD) {
       PVR->HasSameDomain(Standard_True);
-      const TopoDS_Shape& VSD = myDataStructure->SameDomain(VPV).Value();
+      const TopoDS_Shape& VSD = myDataStructure->DS().ShapeSameDomain(VPV).First();
       Standard_Integer iVSD = myDataStructure->Shape(VSD);
       if (iVSD == iVRE) PVR->SameDomain(VIG);
       else              PVR->SameDomain(VSD);