-
Notifications
You must be signed in to change notification settings - Fork 466
Remove deprecated std::allocator
members
#4364
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
Conversation
Clang format is complaining. Stupid question, how can I run it? I'm using Codespaces. |
I tried |
Just follow the README: https://github.com/p4lang/p4c#installing-p4c-from-source |
Btw if you are trying to get C++20 to work, there is much more to do... I've started few weeks ago in #4297 and hit multiple problems. Sadly I don't have much time for that right now. |
I am not sure how codespaces works, but
Well, it can't hurt to start in small increments. |
For sure it does. The point of the comment was making sure we don't both end up independently doing very similar changes (this one is quite simple, some of the other may not be...). I will try to separate what can be used from my original PR so it can be merged. |
I just tried Codespaces (really neat stuff) and to get it to work you need to run |
Yes, Codespaces is great! Did you find out a shortcut to fixing the formatting issues, or do I really have to install all p4c dependencies just to format some files? I know nothing about cmake, so would be very grateful about a concrete list of commands I can start from a vanilla Codespaces instance. (Will share the list if I figure it out.) |
should do the trick. We should really provide some simple install scripts. Everything we have now is built for CI.
Unfortunately, some checks are required. Maybe we can refactor CMake in a way to run the linters without requiring installing some dependencies. But that is tricky. |
I would be quite weary of that. If one needs to format .cpp/.h files, it means they have modified them and therefore they should also check it compiles. What might be a good idea is to improve the linter CI output to actually indicate what is wrong/how it should be formatted, so that for very simple cases it would actually make sense to just look at the output from CI and format accordingly, without re-running clang-format locally (I personally tend to run the compiler, but not format, but that is probably my mistake :-D). |
Well, technically CI takes care of that for you. Sometimes you just want to make a quick change. Even in CI we currently need to install all the dependencies just to run a linter check. That doesn't seem right.
We do have this, clang-format is just a bit hard to read sometimes. This is the current output:
Although I am sure we can make this prettier. |
Thanks a lot, Fabian! Looks like #4373 is taking care of things -- thanks @vistill -- but this will be very helpful for future reference. I also didn't realize that clang-format actually showed me how it wants things formatted, as you noted the output is quite subtle. +1 that making sure that code compiles is the job of CI. |
The change replaces
std::allocator
members that were deprecated in C++17 and removed in C++20, see https://en.cppreference.com/w/cpp/memory/allocator for a detailed list.