Skip to content
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

Use standard feature testing #572

Open
benedekkupper opened this issue Jul 24, 2022 · 2 comments
Open

Use standard feature testing #572

benedekkupper opened this issue Jul 24, 2022 · 2 comments
Assignees

Comments

@benedekkupper
Copy link
Contributor

ETL is doing a lot of its own detection on which language features are supported. The problem is, it's not very accurate. I got here because by updating ETL in my C++20 project the build has failed. The problem boils down to the #define ETL_NO_SMALL_CHAR_SUPPORT ETL_CPP20_NOT_SUPPORTED line. This condition is correct as it is spelled out. However, GCC 10 sets __cplusplus to 201709L for -std=gnu++20, so the macro gets an incorrect value, compilation fails due to duplicate definition of char8_t.

A better way to deal with these issues (at least from C++20) is relying on the C++ standard feature tests. These same macros could be defined by ETL itself for earlier C++ versions, as long as the __cplusplus numbering pitfall mentioned above is handled well. (A big oversight from the feature test design is not adding a macro to check if feature test macros are available at all or not.)

@benedekkupper
Copy link
Contributor Author

Any timeline for merging this branch? The later it gets done, the more additional work it generates.

@jwellbelove
Copy link
Contributor

jwellbelove commented Dec 13, 2022

Between holidaying in Malta and catching a bad cold, I've not looked at the ETL for a few weeks. I have several things to work on for the ETL, so I'm going to have to try to work through them over xmas as I get the free time.

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

No branches or pull requests

2 participants