Skip to content

Make CPROVER intrinsics proper prototypes #7533

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
merged 4 commits into from
Feb 16, 2023

Conversation

tautschnig
Copy link
Collaborator

Forward declarations without arguments are deprecated in C.

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

@tautschnig tautschnig force-pushed the cleanup/library-decls branch 2 times, most recently from 2419eeb to 3140a77 Compare February 9, 2023 16:21
We previously maintained a function call, which would end up being type
in-consistent if there were multiple uses of
`__CPROVER_enum_is_in_range` with distinct enum types. Instead, have the
C front-end create an (and immediately lower) an expression. The only
bit of care that's currently required is to ensure that goto_check_ct
does not end up creating assertions over the resulting expression.
@tautschnig tautschnig force-pushed the cleanup/library-decls branch 2 times, most recently from ed24286 to e822aa9 Compare February 13, 2023 14:44
Forward declarations without arguments are deprecated in C. Polymorphic
built-ins now have dummy declarations that are only in effect when
running library checks. Our own C front-end will type check them
properly and won't rely on forward declarations.
@tautschnig tautschnig force-pushed the cleanup/library-decls branch from e822aa9 to 7ff9285 Compare February 13, 2023 15:13
C uses '(void)' to denote this, not an empty list of parameters.
Clang 15 complains about GNU-style line markers (`# <number>` instead of
`#line <number>`), which we don't need to do anything about.

Fixes: diffblue#7525
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.

Very glad it wasn't me who fixed this one.

@peterschrammel peterschrammel removed their assignment Feb 16, 2023
@tautschnig tautschnig merged commit 76593f8 into diffblue:develop Feb 16, 2023
@tautschnig tautschnig deleted the cleanup/library-decls branch February 16, 2023 14:31
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.

5 participants