Skip to content

C front-end: do not warn when re-initialising a variable with the same value #8695

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

Closed

Conversation

tautschnig
Copy link
Collaborator

There is no surprising behaviour when all initialisers are the same.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

…e value

There is no surprising behaviour when all initialisers are the same.
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.39%. Comparing base (4a1a325) to head (e03011e).

Files with missing lines Patch % Lines
src/ansi-c/c_typecheck_base.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8695      +/-   ##
===========================================
- Coverage    80.40%   80.39%   -0.01%     
===========================================
  Files         1688     1688              
  Lines       207403   207400       -3     
  Branches        73       73              
===========================================
- Hits        166763   166745      -18     
- Misses       40640    40655      +15     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kroening
Copy link
Member

Does the C standard guarantee that this works?

@tautschnig
Copy link
Collaborator Author

Does the C standard guarantee that this works?

The C standard would forbid a redefinition; yet we are seeing those in the C front-end as we (intentionally) do those redefinitions in our C model library. That said, the better fix might be to just no add (redundant zero-)initialisers in the model library. Will try.

@tautschnig
Copy link
Collaborator Author

Closing in favour of #8698.

@tautschnig tautschnig closed this Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants