-
Notifications
You must be signed in to change notification settings - Fork 457
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
Allow --Wdisable
to take precedence over --Werror
for warning messages
#4894
Conversation
Signed-off-by: Kyle Cripps <[email protected]>
Signed-off-by: Kyle Cripps <[email protected]>
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.
Should there be a test-case for this?
(From what I can see, the code is OK.)
I do not know how to test command-line options using the existing infrastructure. |
Me neither, I'm afraid. @vlstill, @fruffy, @ChrisDodd ? |
…emoted Signed-off-by: Kyle Cripps <[email protected]>
Apologies, I forgot about diagnostics that are both errors and warnings. The original changes I proposed in this PR will not work. @ajwalton Please see the new changes. |
Signed-off-by: Kyle Cripps <[email protected]>
Signed-off-by: Kyle Cripps <[email protected]>
You can set up tests in CMake with custom arguments like this: https://github.com/p4lang/p4c/blob/main/backends/p4test/CMakeLists.txt#L118 I do not recall whether this also supports reference files, however. |
Signed-off-by: Kyle Cripps <[email protected]>
Signed-off-by: Kyle Cripps <[email protected]>
Signed-off-by: Kyle Cripps <[email protected]>
Sorry for all of the updates. The PR is now ready for review (and I will squash all commits when merging). |
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, thanks!
I think the precedent exists primarily because of neglect, not because of a conscious decision. We should consider building some test infrastructure that makes parameter/feature flag tests like these easier to add. |
@fruffy I agree that we should build such testing mechanism. I am just saying that it can and should be done independently in a different PR. For now I will be happy to manually generate and share the output of any combination of options. |
No problem, not requesting it for this particular PR but something we should definitely keep track of if it keeps coming up. |
Does anyone else want to review this? If not, I'll probably merge this soon. |
…sages (p4lang#4894) * Allow --Wdisable to take precedence over --Werror for warning messages Signed-off-by: Kyle Cripps <[email protected]> * Add const qualifier Signed-off-by: Kyle Cripps <[email protected]> * Make sure to still prevent errors that are also warnings from being demoted Signed-off-by: Kyle Cripps <[email protected]> * appease cpplint Signed-off-by: Kyle Cripps <[email protected]> * appease cpplint Signed-off-by: Kyle Cripps <[email protected]> * Replace all ::warning(ErrorType::ERR_* with ErrorType::WARN_* Signed-off-by: Kyle Cripps <[email protected]> * ERR_DUPLICATE -> WARN_DUPLICATE Signed-off-by: Kyle Cripps <[email protected]> * invert logic Signed-off-by: Kyle Cripps <[email protected]> --------- Signed-off-by: Kyle Cripps <[email protected]>
This reverts a change that was introduced by #4366, and is in fact redundant for the purpose of #4366 (it was originally necessary, but later became redundant after updates were made to that PR). Not only was it redundant, but it also introduced some undesired behavior (see #4365 (comment) and related discussion).Edit: See #4894 (comment)For the following P4 program:
The command-line options
p4test tmp.p4 --dump tmp --Werror --Wdisable=uninitialized_use --Wdisable=invalid_header
currently result in:but should result in no errors or warnings.