Nebukam / PCGExtendedToolkit

PCGEx is a free (libre) Unreal 5 plugin that expands PCG capabilities. It offers a variety of high-performance nodes; with an edge for building relational graphs (Freeform, Delaunay, Voronoi, MST etc) and pathfinding; and much more.
MIT License
91 stars 10 forks source link

M1 Mac compilation errors reintroduced in recent commits #20

Closed AtomicTroop closed 5 months ago

AtomicTroop commented 5 months ago

Hi again,

I pulled your changes from the last five days and it looks like some compilation errors are back again:


PCGExAttributeRemap.cpp (introduced in 8cd3ecf9)

0>PCGExAttributeRemap.cpp(201,11): Error  : use 'template' keyword to treat 'SetRange' as a dependent template name
0>                Setter->SetRange<RawT>(
0>                        ^
0>                        template

PCGExGeoPrimtives.cpp (not sure when this issue was reintroduced, but seems like a similar case to the previous ones)


0>PCGExGeoPrimtives.h(182,35): Error  : array index 2 is past the end of the array (which contains 2 elements) [-Werror,-Warray-bounds]
0>                                const TFVtx<DIMENSIONS>& C = *Vertices[2];
0>                                                              ^        ~
0>PCGExGeoHull.h(457,10): Reference  : in instantiation of member function 'PCGExGeo::TFSimplex<2>::UpdateNormal' requested here
0>                        Face->UpdateNormal();
0>                              ^
0>PCGExGeoHull.h(625,11): Reference  : in instantiation of member function 'PCGExGeo::TConvexHull<2>::CalculateFacePlane' requested here
0>                                        if (!CalculateFacePlane(NewFace)) { return false; }
0>                                             ^
0>PCGExGeoHull.h(192,53): Reference  : in instantiation of member function 'PCGExGeo::TConvexHull<2>::CreateCone' requested here
0>                        if (!SingularVertices.Contains(CurrentVertex) && CreateCone()) { CommitCone(); }
0>                                                                         ^
0>PCGExGeoHull.h(848,2): Reference  : in instantiation of member function 'PCGExGeo::TConvexHull<2>::ProcessNext' requested here
0>        PCGEX_HULL_CLASS(2)
0>        ^
0>PCGExGeoHull.h(846,49): Reference  : expanded from macro 'PCGEX_HULL_CLASS'
0>                virtual bool ExecuteTask() override{if (Hull->ProcessNext()){Manager->Start<FPCGExProcessHull##_NUM##Task>(TaskIndex, PointIO, Hull); return true;} return false;}};
0>                                                              ^
0>PCGExGeoPrimtives.h(116,3): Reference  : array 'Vertices' declared here
0>                TFVtx<DIMENSIONS>* Vertices[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(194,5): Error  : array index 2 is past the end of the array (which contains 2 elements) [-Werror,-Warray-bounds]
0>                                Normal[2] = f * Nz;
0>                                ^      ~
0>PCGExGeoPrimtives.h(109,3): Reference  : array 'Normal' declared here
0>                double Normal[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(214,35): Error  : array index 2 is past the end of the array (which contains 2 elements) [-Werror,-Warray-bounds]
0>                                const TFVtx<DIMENSIONS>& C = *Vertices[2];
0>                                                              ^        ~
0>PCGExGeoPrimtives.h(116,3): Reference  : array 'Vertices' declared here
0>                TFVtx<DIMENSIONS>* Vertices[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(215,35): Error  : array index 3 is past the end of the array (which contains 2 elements) [-Werror,-Warray-bounds]
0>                                const TFVtx<DIMENSIONS>& D = *Vertices[3];
0>                                                              ^        ~
0>PCGExGeoPrimtives.h(116,3): Reference  : array 'Vertices' declared here
0>                TFVtx<DIMENSIONS>* Vertices[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(237,5): Error  : array index 2 is past the end of the array (which contains 2 elements) [-Werror,-Warray-bounds]
0>                                Normal[2] = F * Nz;
0>                                ^      ~
0>PCGExGeoPrimtives.h(109,3): Reference  : array 'Normal' declared here
0>                double Normal[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(238,5): Error  : array index 3 is past the end of the array (which contains 2 elements) [-Werror,-Warray-bounds]
0>                                Normal[3] = F * Nw;
0>                                ^      ~
0>PCGExGeoPrimtives.h(109,3): Reference  : array 'Normal' declared here
0>                double Normal[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(215,35): Error  : array index 3 is past the end of the array (which contains 3 elements) [-Werror,-Warray-bounds]
0>                                const TFVtx<DIMENSIONS>& D = *Vertices[3];
0>                                                              ^        ~
0>PCGExGeoHull.h(457,10): Reference  : in instantiation of member function 'PCGExGeo::TFSimplex<3>::UpdateNormal' requested here
0>                        Face->UpdateNormal();
0>                              ^
0>PCGExGeoHull.h(625,11): Reference  : in instantiation of member function 'PCGExGeo::TConvexHull<3>::CalculateFacePlane' requested here
0>                                        if (!CalculateFacePlane(NewFace)) { return false; }
0>                                             ^
0>PCGExGeoHull.h(192,53): Reference  : in instantiation of member function 'PCGExGeo::TConvexHull<3>::CreateCone' requested here
0>                        if (!SingularVertices.Contains(CurrentVertex) && CreateCone()) { CommitCone(); }
0>                                                                         ^
0>PCGExGeoHull.h(850,2): Reference  : in instantiation of member function 'PCGExGeo::TConvexHull<3>::ProcessNext' requested here
0>        PCGEX_HULL_CLASS(3)
0>        ^
0>PCGExGeoHull.h(846,49): Reference  : expanded from macro 'PCGEX_HULL_CLASS'
0>                virtual bool ExecuteTask() override{if (Hull->ProcessNext()){Manager->Start<FPCGExProcessHull##_NUM##Task>(TaskIndex, PointIO, Hull); return true;} return false;}};
0>                                                              ^
0>PCGExGeoPrimtives.h(116,3): Reference  : array 'Vertices' declared here
0>                TFVtx<DIMENSIONS>* Vertices[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(238,5): Error  : array index 3 is past the end of the array (which contains 3 elements) [-Werror,-Warray-bounds]
0>                                Normal[3] = F * Nw;
0>                                ^      ~
0>PCGExGeoPrimtives.h(109,3): Reference  : array 'Normal' declared here
0>                double Normal[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(319,57): Error  : array index 3 is past the end of the array (which contains 3 elements) [-Werror,-Warray-bounds]
0>                                Triangles.Emplace(Vertices[0]->Id, Vertices[1]->Id, Vertices[3]->Id);
0>                                                                                    ^        ~
0>PCGExGeoDelaunay.h(145,20): Reference  : in instantiation of member function 'PCGExGeo::TFSimplex<3>::GetTriangles' requested here
0>                                Cell->Simplex->GetTriangles(Triangles);
0>                                               ^
0>PCGExBuildDelaunayGraph2D.cpp(191,49): Reference  : in instantiation of member function 'PCGExGeo::TDelaunayTriangulation<3, PCGExGeo::TConvexHull3>::GetUrquhartEdges' requested here
0>                if (Settings->bUrquhart) { Context->Delaunay->GetUrquhartEdges(Edges); }
0>                                                              ^
0>PCGExGeoPrimtives.h(116,3): Reference  : array 'Vertices' declared here
0>                TFVtx<DIMENSIONS>* Vertices[DIMENSIONS];
0>                ^
0>PCGExGeoPrimtives.h(320,57): Error  : array index 3 is past the end of the array (which contains 3 elements) [-Werror,-Warray-bounds]
0>                                Triangles.Emplace(Vertices[0]->Id, Vertices[2]->Id, Vertices[3]->Id);
0>                                                                                    ^        ~
0>PCGExGeoPrimtives.h(116,3): Reference  : array 'Vertices' declared here
0>                TFVtx<DIMENSIONS>* Vertices[DIMENSIONS];
0>                ^
Nebukam commented 5 months ago

DAMN, I made zero change to the Geometry stuff so it's definitely a collateral from the initial blocker. I'll look into that right away -- hopefully it's a quick fix.

Thanks for the report!

AtomicTroop commented 5 months ago

Heh, looks like an explicit template keyword on line 201 of PCGExAttributeRemap.cpp fixes the latter errors too:

...
Setter->template SetRange<RawT>(
...
Nebukam commented 5 months ago

I'll submit that as a fix, but it's a really annoying discrepancy between platforms: this one definitely slips through my setup on a windows machine, even with Cpp17 with either build settings to V2 3 or 4.

Nebukam commented 5 months ago

Submitted a fix, but again, thanks a lot <3