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

fix c++20-compat false positive #909

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

jaskij
Copy link
Contributor

@jaskij jaskij commented Jun 27, 2024

Fix #906

Copy link

Review changes with SemanticDiff.

@jaskij
Copy link
Contributor Author

jaskij commented Jun 27, 2024

Explaining the pragmas:

#pragma GCC diagnostic push			// store current diagnostics setup
#pragma GCC diagnostic ignored "-Wc++20-compat"	// disable C++20 compat warning

// code goes here

#pragma GCC diagnostic pop			// resture previously stored diagnostic setup

@jaskij
Copy link
Contributor Author

jaskij commented Jun 27, 2024

I went with the pragma approach because this is the only place which causes the error

@jwellbelove
Copy link
Contributor

jwellbelove commented Jun 27, 2024

To control warnings so far I've created headers that enable and disable them.
See example include/etl/private/diagnostic_array_bounds_push.h and include/etl/private/diagnostic_pop.h

@jwellbelove
Copy link
Contributor

Example of use...

#include "etl/private/diagnostic_array_bounds_push.h"
      position1 = compare_text.find_last_not_of(STR('C'), 100);
      position2 = text.find_last_not_of(STR('C'), 100);

      CHECK_EQUAL(position1, position2);
#include "etl/private/diagnostic_pop.h"

@jaskij
Copy link
Contributor Author

jaskij commented Jun 27, 2024

Thank you for pointing that out, moved the diagnostics to their own file.

@jwellbelove jwellbelove changed the base branch from master to development June 27, 2024 20:07
@jwellbelove jwellbelove merged commit 64f620c into ETLCPP:development Jul 2, 2024
63 checks passed
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.

platform.h error when building with GCC 13 using C++14
2 participants