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

C++: Add basic modeling of functions that don't throw #17298

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

paldepind
Copy link
Contributor

@paldepind paldepind commented Aug 26, 2024

Add basic modeling of functions that don't throw.

For now I've just let the classes for the two C functions mentioned in the issue, memset and memcpy, extend the new class.

@paldepind paldepind requested a review from a team as a code owner August 26, 2024 07:02
@github-actions github-actions bot added the C++ label Aug 26, 2024
*
* Note: The `throw` specifier was deprecated in C++11 and removed in C++17.
*/
class NoexceptFunction extends NonThrowingFunction {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the throw() signifier is deprecated & removed in the C++ standard I decided to just name this class after the noexcept signifier. This seems simpler than having the name reflect both the signifiers.

@paldepind
Copy link
Contributor Author

If I'm reading the DCA results correctly this PR does not have any effect on the query results for the projects that DCA covers.

Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

Minor comments, changes and tests otherwise LGTM.

I think we should model a few more functions with this, though as it currently only affects one query it's probably not worth spending too long on it. Perhaps printf (see Printf, Fprintf, Sprintf), strcpy (StrcpyFunction)
and strcat (StrcatFunction) would be nice to have as well.

Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

LGTM. :)

@paldepind paldepind merged commit edeefe5 into github:main Aug 28, 2024
16 checks passed
@paldepind paldepind deleted the model-functions-that-dont-throw branch August 29, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants