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

Avoid duplicate "warning:" or "error:" output #1359

Merged
merged 3 commits into from
Apr 25, 2024

Conversation

tautschnig
Copy link
Collaborator

The gcc message handler already took care of this; make the console message
handler do the same.

@kroening
Copy link
Member

kroening commented Sep 8, 2017

Uhoh, lots of regressions check for "CONVERSION ERROR". Not clear whether to change the tests or do a special case for that.

@tautschnig tautschnig self-assigned this Sep 8, 2017
@tautschnig
Copy link
Collaborator Author

Assigning to myself for further work at a later time. No urgency/dependency here for anyone.

tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 4, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 4, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 5, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 5, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 6, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 8, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 8, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 8, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 8, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Jan 8, 2021
@codecov
Copy link

codecov bot commented Jan 10, 2021

Codecov Report

Attention: Patch coverage is 31.50685% with 50 lines in your changes are missing coverage. Please review.

Project coverage is 78.23%. Comparing base (1ed7b2f) to head (613289b).

Files Patch % Lines
src/cpp/cpp_typecheck_expr.cpp 16.66% 15 Missing ⚠️
src/goto-cc/ms_cl_mode.cpp 0.00% 5 Missing ⚠️
src/goto-cc/armcc_mode.cpp 0.00% 4 Missing ⚠️
src/ansi-c/c_typecheck_base.cpp 0.00% 3 Missing ⚠️
src/cpp/cpp_typecheck_compound_type.cpp 40.00% 3 Missing ⚠️
src/goto-cc/cw_mode.cpp 0.00% 3 Missing ⚠️
src/goto-programs/builtin_functions.cpp 0.00% 3 Missing ⚠️
src/cpp/cpp_typecheck_resolve.cpp 0.00% 2 Missing ⚠️
src/goto-cc/cl_message_handler.cpp 0.00% 2 Missing ⚠️
src/goto-cc/cl_message_handler.h 0.00% 2 Missing ⚠️
... and 7 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1359      +/-   ##
===========================================
- Coverage    78.38%   78.23%   -0.15%     
===========================================
  Files         1720     1720              
  Lines       187982   188342     +360     
  Branches     18474    18466       -8     
===========================================
+ Hits        147346   147353       +7     
- Misses       40636    40989     +353     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tautschnig
Copy link
Collaborator Author

Uhoh, lots of regressions check for "CONVERSION ERROR". Not clear whether to change the tests or do a special case for that.

I have revamped this PR, and none of the "CONVERSION ERROR" messages should be affected. It's really just to avoid "warning: warning: " being printed to users.

@tautschnig tautschnig removed their assignment Jan 10, 2021
Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much respect for resolving a 2017 issue!

@TGWDB
Copy link
Contributor

TGWDB commented May 3, 2023

Closing due to age (no further comment on PR content), please reopen with rebase on develop if you intent to continue this work.

@TGWDB TGWDB closed this May 3, 2023
@tautschnig
Copy link
Collaborator Author

Re-opening: this is just waiting for a review.

@tautschnig tautschnig reopened this May 4, 2023
@tautschnig tautschnig force-pushed the duplicate-warning branch from 0ef65f8 to d0bc9d3 Compare May 4, 2023 12:11
@TGWDB
Copy link
Contributor

TGWDB commented May 10, 2023

@remi-delmas-3000 @kroening Woulda review be possible?

@tautschnig tautschnig self-assigned this May 31, 2023
@tautschnig tautschnig force-pushed the duplicate-warning branch from d0bc9d3 to 5af219a Compare June 1, 2023 18:54
@tautschnig tautschnig removed their assignment Jun 1, 2023

/// With \p yes set to \c true, prefix warnings with an error message.
/// \param yes: Whether or not to prefix warnings.
void print_warnings_as_errors(bool yes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say it depends on how closely we'd like to mimic the behaviour of Visual Studio and GCC. Prior to this change, we just printed "warning" but nonetheless failed with a non-zero exit code when Werror was used. With this change, we would actually print "error" for such now-fatal warnings, as those compilers do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels a bit cosmetic, but why not.

The gcc and cl message handlers already take care of this, and we had a
mix of some messages including the "warning:" or "error:" prefix when
others don't.
…y to warning

We already did this for GCC, but we can also do this for other modes
(ARMCC, CodeWarrior, LD, CL, LINK).
We already treated warnings as errors (if requested via command-line
options), but we should also mimic the output presented by CL/GCC with
those command-line options set.
@kroening kroening merged commit f9f84f3 into diffblue:develop Apr 25, 2024
38 of 40 checks passed
@tautschnig tautschnig deleted the duplicate-warning branch April 26, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants