This simple program can't be compiled on 14.1: #include <csetjmp> int main() { } $ c++ x.cpp In file included from x.cpp:2: /usr/include/c++/v1/csetjmp:40:6: error: "If libc++ starts defining <setjmp.h>, the __has_include check should move to libc++'s <setjmp.h>" 40 | # error "If libc++ starts defining <setjmp.h>, the __has_include check should move to libc++'s <setjmp.h>" | ^ 1 error generated. The error message doesn't explain what is wrong with the program. The C++ standard says that <csetjmp> should be included for the C++ feature std::jmp_buf. See here: https://en.cppreference.com/w/cpp/utility/program/jmp_buf
I can't reproduce this on freshly installed 14.1-RELEASE. The program compiles just fine. How have you installed your system?
I had a similar issue recently on CURRENT. In my case the cause was that I had built base from sources forgetting to run "make delete-old". After running it everything was fixed.
(In reply to Lorenzo Salvadore from comment #2) Ah yes, this is because the old copy of /usr/include/c++/v1/setjmp.h must be deleted upon an upgrade. A fresh install will never have this issue.
*** Bug 281257 has been marked as a duplicate of this bug. ***
Thanks, deleting the above mentioned file appears to fix everything related to csetjmp please add this info to UPDATING regarding setjmp.h and csetjmp also there are two setjmp.h files in "/usr/include/c++/v1" - shouldn't BOTH be deleted? (/usr/include/c++/v1/tr1/setjmp.h is a symlink to /usr/include/c++/v1/setjmp.h) NOTE: in some cases, like a massive ports upgrade, using "make delete-old" might not be desirable until after many ports have already been re-built. I did not use 'portupgrade' but it could very likely break something (so I do this step last). But this is a nit as long as UPDATING covers the topic, I'd think.
(In reply to Bob Frazier from comment #5) $ grep setjmp.h ObsoleteFiles.inc OLD_FILES+=usr/include/c++/v1/setjmp.h OLD_FILES+=usr/include/c++/v1/tr1/setjmp.h Both of these are in ObsoleteFiles.inc, the latter has been there for quite a long time, since the tr1 directory was cleaned up. Everybody should run make delete-old after upgrading, this is the only supported mechanism. Adding notes to UPDATING might work, but if people don't follow instructions then it might not make much difference. :)
(In reply to Bob Frazier from comment #5) QUOTE NOTE: in some cases, like a massive ports upgrade, using "make delete-old" might not be desirable until after many ports have already been re-built. END QUOTE Avoiding running "make delete-old" leads to the risk of silently finding and using out-of-date content in some of the upgrade's build activity. Such can make it harder to discover that there are problems to fix to be sure that the right content is used. "make delete-old-libs" is somewhat different for the criteria relative to keeping programs that do not yet have updated installs operational (still using old .so files and such). "make delete-old-libs" is appropriate after the upgrades to versions that use the newer .so libraries are in use instead.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=157802238b5aa7722aff40317fe6d05f5c975d71 commit 157802238b5aa7722aff40317fe6d05f5c975d71 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-09-05 19:55:44 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-09-05 19:58:51 +0000 Add UPDATING note about running make delete-old after libc++ 18 upgrade PR: 279692 MFC after: 3 days UPDATING | 7 +++++++ 1 file changed, 7 insertions(+)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=28ff3ab2ab064224cd1fc0885040c3c47ed5ef4d commit 28ff3ab2ab064224cd1fc0885040c3c47ed5ef4d Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-09-05 19:55:44 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-09-08 07:48:57 +0000 Add UPDATING note about running make delete-old after libc++ 18 upgrade PR: 279692 MFC after: 3 days (cherry picked from commit 157802238b5aa7722aff40317fe6d05f5c975d71) UPDATING | 7 +++++++ 1 file changed, 7 insertions(+)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=6b147f693b91f16db7ba6193611f6f4d2ed762a5 commit 6b147f693b91f16db7ba6193611f6f4d2ed762a5 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-09-05 19:55:44 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-09-08 07:51:37 +0000 Add UPDATING note about running make delete-old after libc++ 18 upgrade PR: 279692 MFC after: 3 days (cherry picked from commit 157802238b5aa7722aff40317fe6d05f5c975d71) UPDATING | 7 +++++++ 1 file changed, 7 insertions(+)
A commit in branch releng/13.4 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5096328dd7cbe79628098f10ab92eb4ab70d5fce commit 5096328dd7cbe79628098f10ab92eb4ab70d5fce Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-09-05 19:55:44 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-09-09 17:49:39 +0000 Add UPDATING note about running make delete-old after libc++ 18 upgrade PR: 279692 MFC after: 3 days (cherry picked from commit 157802238b5aa7722aff40317fe6d05f5c975d71) (cherry picked from commit 6b147f693b91f16db7ba6193611f6f4d2ed762a5) Approved by: re (cperciva) UPDATING | 7 +++++++ 1 file changed, 7 insertions(+)