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

warnings on clang-17.0.2 #313

Closed
andrewcorrigan opened this issue May 22, 2024 · 6 comments
Closed

warnings on clang-17.0.2 #313

andrewcorrigan opened this issue May 22, 2024 · 6 comments
Labels

Comments

@andrewcorrigan
Copy link
Contributor

My last PR, 312, fixed an error I was encountering using MSVC. Unfortunately, this is now triggering warnings on Clang. Would it make sense to add an #if guard and redo my last PR so that we only include the space for compilers that actually require it? This way, MSVC continues to compile and hopefully we could silence warnings from compilers that consider this deprecated?

/third_party/obake/mppp/include/mp++/detail/integer_literals.hpp:410:1: warning: identifier '_z1' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
  410 | MPPP_DECLARE_INTEGRAL_UDL(1)
      | ^
@bluescarni
Copy link
Owner

Would it be possible instead to suppress the specific warning with a pragma or compiler flag for MSVC?

#ifdef-fing would certainly work, but I would like to avoid code repetition if possible.

@bluescarni
Copy link
Owner

@andrewcorrigan in #314 I restored the original code (i.e., before #312) for the user-defined literals.

I am not seeing any warnings/errors in the CI on MSVC 17.10.

I also think a the original issue might have been solved by MSVC turning this on by default:

https://github.com/MicrosoftDocs/cpp-docs/blob/main/docs/preprocessor/preprocessor-experimental-overview.md

So perhaps it would make sense to turn on this flag in the mp++ build system...

In any case, let me know if you are still having issues. I plan on doing a dot release tomorrow, but I can always quickly do another one if we need to iterate on this.

Closing for the time being.

@andrewcorrigan
Copy link
Contributor Author

I'm really sorry I flaked on this. I'll try out the latest release and report back if there are any issues.

@bluescarni
Copy link
Owner

@andrewcorrigan no worries, let me know how it goes.

@andrewcorrigan
Copy link
Contributor Author

andrewcorrigan commented Nov 12, 2024

I just tried it again and still have the error message without the space (using the current version). If I set /Zc:preprocessor-, to disable the standards conforming preprocessor, then the error goes away. This is using 17.11.4. Which option are you using in CI? I wonder if you can repro the errors I see by enabling the standards conforming preprocessor: /Zc:preprocessor. In my local copy, I need the standards conforming preprocessor, so rather than fine-tune this option I'm going to eliminate the macros entirely and copy and paste the code.

@andrewcorrigan
Copy link
Contributor Author

I dug into the Windows CI setup and was able to reproduces the errors using the conforming preprocessor option...

https://github.com/andrewcorrigan/mppp/actions/runs/11838858846/job/32988951135

I'm going to open a PR in case you want top consider incorporating these changes

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

No branches or pull requests

2 participants