iains / gcc-10-branch

[April 2021] 10.3 plus Darwin additions, initial 10.3 Arm64.
GNU General Public License v2.0
7 stars 2 forks source link

__null_terminated is present in libstdc++-v3/include/bits/fs_path.h #8

Open fxcoudert opened 1 year ago

fxcoudert commented 1 year ago

With the macOS 13 SDK, this crashes the build:

2022-12-11T19:58:09.0672380Z In file included from /private/tmp/gccA10-20221211-4993-1miwm67/gcc-10.4.0/build/x86_64-apple-darwin22/libstdc++-v3/include/filesystem:45,
2022-12-11T19:58:09.0672550Z                  from ../../../../../libstdc++-v3/src/c++17/fs_dir.cc:30:
2022-12-11T19:58:09.0673150Z /private/tmp/gccA10-20221211-4993-1miwm67/gcc-10.4.0/build/x86_64-apple-darwin22/libstdc++-v3/include/bits/fs_path.h:133:30: error: abstract declarator 'std::filesystem::__cxx11::__detail::<unnamed struct>' used as declaration
2022-12-11T19:58:09.0673230Z   133 |   struct __null_terminated { };
2022-12-11T19:58:09.0673290Z       |                              ^
2022-12-11T19:58:09.0673600Z /private/tmp/gccA10-20221211-4993-1miwm67/gcc-10.4.0/build/x86_64-apple-darwin22/libstdc++-v3/include/bits/fs_path.h:536:62: error: expected identifier before ')' token
2022-12-11T19:58:09.0673860Z   536 |     _S_convert(value_type* __src, __detail::__null_terminated)
2022-12-11T19:58:09.0673950Z       |                                                              ^
2022-12-11T19:58:09.0674280Z /private/tmp/gccA10-20221211-4993-1miwm67/gcc-10.4.0/build/x86_64-apple-darwin22/libstdc++-v3/include/bits/fs_path.h:540:68: error: expected identifier before ')' token
2022-12-11T19:58:09.0674400Z   540 |     _S_convert(const value_type* __src, __detail::__null_terminated)
2022-12-11T19:58:09.0674480Z       |                                                                    ^

There is a fix for a similar issue at https://github.com/gcc-mirror/gcc/commit/7137ae4051ae71bb7fc7fd59d956952c53403239 but it is not sufficient on the 10 branch.

iains commented 1 year ago

thanks for the report; "not sufficient" means it does not apply or that it does not cover all the cases where __null_terminated is present?

.. at some point I want to release 10.4 but there are a few wrinkles to sort out (this is an additional one).

fxcoudert commented 1 year ago

The commit I linked is to include/experimental/bits/fs_path.h. It was backported from the 12 and 11 branches. On the 10 branch, there is the present additional failure in include/bits/fs_path.h (same issue, but different file).

I'm testing the same fix (replace __null_terminated by __nul_terminated) in https://github.com/Homebrew/homebrew-core/pull/117916 right now

iains commented 1 year ago

The commit I linked is to include/experimental/bits/fs_path.h. It was backported from the 12 and 11 branches. On the 10 branch, there is the present additional failure in include/bits/fs_path.h (same issue, but different file).

Ah, I think Jonathan back ported to 11 and 12 .. was not sure if he did 10 as well.

I'm testing the same fix (replace __null_terminated by __nul_terminated) in Homebrew/homebrew-core#117916 right now

OK that's all I'd be doing anyway :)