Skip to content

Support C17, C23 standards with goto-cc #8673

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

Merged

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Jul 4, 2025

We previously added the necessary language features in the C front end, but failed to permit selection of these standards in goto-cc.

Also, GCC >= 11 and Clang >= 17 support C23-style attributes irrespective of the configured language standard. So let's accept these in our C front end whenever operating in GCC/Clang mode.

Fixes: #8671

  • 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.

Copy link

codecov bot commented Jul 5, 2025

Codecov Report

Attention: Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.39%. Comparing base (e88ed5f) to head (fbb9502).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/ansi-c/scanner.l 40.00% 3 Missing ⚠️
src/goto-cc/gcc_mode.cpp 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8673   +/-   ##
========================================
  Coverage    80.39%   80.39%           
========================================
  Files         1688     1688           
  Lines       207387   207399   +12     
  Branches        73       73           
========================================
+ Hits        166728   166747   +19     
+ Misses       40659    40652    -7     

☔ 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 kroening assigned tautschnig and unassigned kroening Jul 5, 2025
@tautschnig tautschnig force-pushed the bugfixes/8617-attributes-c23 branch from 4ef6a5e to c460510 Compare July 5, 2025 09:27
@tautschnig tautschnig force-pushed the bugfixes/8617-attributes-c23 branch from c460510 to de9db3c Compare July 7, 2025 09:17
@archigup
Copy link

archigup commented Jul 8, 2025

Tested and works for me.
Shouldn't the closes be #8671 and not #8617?

We previously added the necessary language features in the C front end,
but failed to permit selection of these standards in goto-cc.

Also, GCC >= 11, Clang >= 17, and Visual Studio >= 2022 support
C23-style attributes irrespective of the configured language standard.
So let's accept these in our C front end whenever operating in these
modes.

Fixes: diffblue#8671
@tautschnig tautschnig force-pushed the bugfixes/8617-attributes-c23 branch from de9db3c to fbb9502 Compare July 8, 2025 09:06
@tautschnig
Copy link
Collaborator Author

Tested and works for me. Shouldn't the closes be #8671 and not #8617?

Thank you for catching that!

@tautschnig tautschnig merged commit f806d1e into diffblue:develop Jul 8, 2025
40 of 41 checks passed
@tautschnig tautschnig deleted the bugfixes/8617-attributes-c23 branch July 8, 2025 11:36
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.

goto-cc fails to parse enum/struct/unions with C23 attribute sequences
4 participants