Skip to content

Fix std::u8string vs std::string mismatch in tool/val/val.cpp vulkan-sdk-1.4.328(.2)#6438

Open
aminiussi wants to merge 1 commit intoKhronosGroup:vulkan-sdk-1.4.328from
aminiussi:vulkan-sdk-1.4.328
Open

Fix std::u8string vs std::string mismatch in tool/val/val.cpp vulkan-sdk-1.4.328(.2)#6438
aminiussi wants to merge 1 commit intoKhronosGroup:vulkan-sdk-1.4.328from
aminiussi:vulkan-sdk-1.4.328

Conversation

@aminiussi
Copy link
Copy Markdown

There is the following piece of code in val.cpp:

      // Copy the string, because in C++20 the result type of
      // std::filesystem::path::u8string changes type from std::string to
      // std::u8string, and the pointer type ends up incompatible. Normalize
      // to std::string first via copying.
      const auto filepath_u8str = filepath.u8string();
      const std::string filepath_str(filepath_u8str.begin(),
                                     filepath_u8str.end());
      if (!process_single_file(filepath.u8string().c_str(), target_env, options,
                               false)) {
        succeed = false;
      }

That is, filepath_str is created but not used. It fails with C++ 20 for reasons mentioned in the source code comment.

It's been fixed in other branches but I need to use homogeneous versions for vulkan components and https://github.com/KhronosGroup/SPIRV-Headers stops at 1.4.328.1 so a fixed vulkan-sdk-1.4.328 for Tools would be nice (I download everything at config time through FetchContent for my project).
I guess it could be tagged vulkan-sdk-1.4.328.1 ?

Thx

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Nov 27, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants