-
Notifications
You must be signed in to change notification settings - Fork 447
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
Build with -pedantic, fix problems #3892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Alternatively we could introduce a new option, like ENABLE_PEDANTIC_BUILD, on by default, to control this, but personally I dont think it is worth it; similar changes required by -pedantic in bf-p4c were quite small.
6fb088c
to
7ce46d7
Compare
Apparently some checks that run here are not too easy to run locally, I'll go through the problems and see if they can be resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay to me as well, although the loss of designated initializers is a little unfortunate 🙁
I'd wait to see what feedback Chris and/or Mihai have to say about this change before proceeding.
Looks like the Ubuntu 18 build is using GCC 7.5:
But according to dependencies we require "A C++17 compiler. GCC 9.1 or later or Clang 6.0 or later is required.". So this should probably be changed in Ubuntu 18 build. |
7ce46d7
to
da5b506
Compare
Is anyone working to fix the Mac build? |
Please rebase |
@mbudiu-vmw Is it failing to build, or is it building incorrectly and producing errors when you test? I tried just now and it built fine, but 70 tests fail. I did not pass any options to cmake. |
All recent PRs e.g., #3889 are failing due to the MacOS CI build, e.g.: https://github.com/p4lang/p4c/actions/runs/4186877650/jobs/7255975949
|
da5b506
to
179c0ec
Compare
I'll rebase this after #3896 is merged to fix the macOS build. |
They are not standard C++ untill C++20.
db11dff
to
e792401
Compare
I think that
-pedantic
would be beneficial compilation flag on top of the existing warnings. Some positives and negatives:clang-tidy
)This PR enables it and fixes the problems that
-pedantic
has with the current code:{.foo = 4, .bar = 5}
), this is arguably the only one that potentially matters-pedantic
and designated initializers in C++17 (i.e. there is no fine-grained control)Overall, I think the benefits of
-pedantic
overturn its disadvantages, but of course I can barely propose this :-).