Skip to content

Official stance on c++17 support? #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kalmard0 opened this issue Apr 22, 2025 · 6 comments
Closed

Official stance on c++17 support? #103

kalmard0 opened this issue Apr 22, 2025 · 6 comments

Comments

@kalmard0
Copy link
Contributor

After recent changes, inkcpp doesn't compile with the c++17 standard. For me personally this is an issue, as I'm working with development targets whose official compiler support is stuck on c++17.

If inkcpp is supposed to officially continue to support c++17, I can try to send some PRs to enforce that (e.g. in automated tests) and clear up the small changes. If not, I will work around the issue in other ways.

@kalmard0
Copy link
Contributor Author

To be more precise, the specific issue:

src/third_party/inkcpp/inkcpp-master/inkcpp_compiler/json_compiler.cpp:141:56: error: no member named 'starts_with' in
'std::basic_string<char>'; did you mean '_Starts_with'?
  141 |                 if (name_override.starts_with("c-") || name_override.starts_with("g-")) {
      |                                                                      ^~~~~~~~~~~
      |                                                                      _Starts_with

This makes sense as starts_with (https://en.cppreference.com/w/cpp/string/basic_string/starts_with) is a c++20 feature.

However now I see in cmake files that compilation is supposed to be forced to c++17 already, which makes me wonder how this change got past the tests.

@kalmard0
Copy link
Contributor Author

I just found two opposing pieces of cmake configuration for setting language rules:
SET(CMAKE_CXX_STANDARD 20) and target_compile_features(inkcpp_compiler PUBLIC cxx_std_17). I suspect the former overrides the latter.

@kalmard0
Copy link
Contributor Author

Another issue I found: some features that are heavily used in inkcpp are C++20-only on MSVC but pass on other compilers. For example:

D:\a\inkcpp\inkcpp\inkcpp_c\inkcpp.cpp(38,8): error C7555: use of designated initializers requires at least '/std:c++20' [D:\a\inkcpp\inkcpp\build\inkcpp_c\inkcpp_c.vcxproj]

@JBenda
Copy link
Owner

JBenda commented Apr 24, 2025

We started the development with C++20 and at some point we noticed/thought that we do not use enough features to justify it. So we were convinced that we were compiling with C++17

Thank you for spotting the Cmake "conflict".
I will see what to do about the designated initializer error and check your others PRs

Thank you a lot for pointing out the problem and for providing partial solutions.

@JBenda
Copy link
Owner

JBenda commented Apr 29, 2025

see #110

@JBenda
Copy link
Owner

JBenda commented May 13, 2025

#110

@JBenda JBenda closed this as completed May 13, 2025
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 a pull request may close this issue.

2 participants