Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding - GCC13 warning suppressing #96

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-linux-gcc-x64-dynamic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion src/BRepTest/BRepTest_BasicCommands.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down
6 changes: 3 additions & 3 deletions src/MeshTest/MeshTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions src/QANCollection/QANCollection_Handle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/STEPCAFControl/STEPCAFControl_Reader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/TopOpeBRepBuild/TopOpeBRepBuild_GridEE.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Loading