With libc++ 21, math/vtk9 fails to compile, resulting in errors similar to: In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/src/os.cc:14: In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/os.h:11: /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:747:28: error: use of undeclared identifier 'malloc' 747 | T* p = static_cast<T*>(malloc(n * sizeof(T))); | ^~~~~~ /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:752:35: error: use of undeclared identifier 'free' 752 | void deallocate(T* p, size_t) { free(p); } | ^~~~ This is because malloc and free are defined in <cstdlib>, which is not included in vtk's format.h. Add the include to fix the build.
Created attachment 267308 [details] math/vtk9: fix build with libc++ 21
Approved. Please commit it.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=1fe6f247796702372b50b08c464536586f8468c7 commit 1fe6f247796702372b50b08c464536586f8468c7 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2026-01-19 19:58:42 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2026-01-31 18:18:37 +0000 math/vtk9: fix build with libc++ 21 With libc++ 21, math/vtk9 fails to compile, resulting in errors similar to: In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/src/os.cc:14: In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/os.h:11: /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:747:28: error: use of undeclared identifier 'malloc' 747 | T* p = static_cast<T*>(malloc(n * sizeof(T))); | ^~~~~~ /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:752:35: error: use of undeclared identifier 'free' 752 | void deallocate(T* p, size_t) { free(p); } | ^~~~ This is because malloc and free are defined in <cstdlib>, which is not included in vtk's format.h. Add the include to fix the build. PR: 292590 Approved by: yuri (maintainer) MFH: 2026Q1 .../files/patch-ThirdParty_fmt_vtkfmt_vtkfmt_format.h (new) | 10 ++++++++++ 1 file changed, 10 insertions(+)
A commit in branch 2026Q1 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=5939621f420876a9a42754970f89c418d8152de3 commit 5939621f420876a9a42754970f89c418d8152de3 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2026-01-19 19:58:42 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2026-01-31 18:20:15 +0000 math/vtk9: fix build with libc++ 21 With libc++ 21, math/vtk9 fails to compile, resulting in errors similar to: In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/src/os.cc:14: In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/os.h:11: /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:747:28: error: use of undeclared identifier 'malloc' 747 | T* p = static_cast<T*>(malloc(n * sizeof(T))); | ^~~~~~ /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:752:35: error: use of undeclared identifier 'free' 752 | void deallocate(T* p, size_t) { free(p); } | ^~~~ This is because malloc and free are defined in <cstdlib>, which is not included in vtk's format.h. Add the include to fix the build. PR: 292590 Approved by: yuri (maintainer) MFH: 2026Q1 (cherry picked from commit 1fe6f247796702372b50b08c464536586f8468c7) .../files/patch-ThirdParty_fmt_vtkfmt_vtkfmt_format.h (new) | 10 ++++++++++ 1 file changed, 10 insertions(+)