-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[clang-tidy] Rename and move 'cert-oop57-cpp' to 'bugprone-raw-memory-call-on-non-trivial-type' #162039
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
Open
dvbuka
wants to merge
21
commits into
llvm:main
Choose a base branch
from
dvbuka:alias-for-oop57-cpp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+74
−57
Open
[clang-tidy] Rename and move 'cert-oop57-cpp' to 'bugprone-raw-memory-call-on-non-trivial-type' #162039
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
236cee6
[clang-tidy] Add new alias 'libc-memory-calls-on-nontrivial-types' fo…
292cafb
Update clang-tools-extra/docs/clang-tidy/checks/bugprone/libc-memory-…
dvbuka a928e61
Format function names properly
dvbuka d0ba4b3
Update clang-tools-extra/docs/clang-tidy/checks/cert/oop57-cpp.rst
dvbuka 95fd6b5
Update clang-tools-extra/docs/clang-tidy/checks/cert/oop57-cpp.rst
dvbuka f590f55
Add new line
dvbuka 57a3583
Rename to check to raw-memory-call-on-nontrivial-type
dvbuka 1e01e2c
Rename more references to new check name
dvbuka ad1afc4
Update title formatting for raw-memory-call check
dvbuka 691131b
Rename last reference to RAWMEMORYCALLONNONTRIVIALTYPE
dvbuka bb8c690
nontrivial => non-trivial
dvbuka 8f10a75
Update raw-memory-call-on-non-trivial-type.rst
dvbuka 59ca5d0
Add Check to class name, register check in bugprone, and update name …
dvbuka 11047c4
Clang format changes
dvbuka e326e07
Move extra functions description out of each individual option
dvbuka 5e54e7d
Merge branch 'main' into alias-for-oop57-cpp
dvbuka 70f1319
Revert "Move extra functions description out of each individual option"
dvbuka ef26db9
Move default checks out of options
dvbuka f82761e
Update clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-c…
dvbuka 0a1cdaf
Update clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-c…
dvbuka 13f2caf
Update clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-c…
dvbuka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...extra/docs/clang-tidy/checks/bugprone/libc-memory-calls-on-nontrivial-types.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. title:: clang-tidy - bugprone-libc-memory-calls-on-nontrivial-types | ||
|
||
bugprone-libc-memory-calls-on-nontrivial-types | ||
============================================== | ||
|
||
Flags use of the C standard library functions ``memset``, ``memcpy`` and | ||
``memcmp`` and similar derivatives on non-trivial types. | ||
|
||
Options | ||
------- | ||
|
||
.. option:: MemSetNames | ||
|
||
Specify extra functions to flag that act similarly to ``memset``. | ||
Specify names in a semicolon delimited list. | ||
Default is an empty string. | ||
The check will detect the following functions: | ||
``memset``, ``std::memset``. | ||
|
||
.. option:: MemCpyNames | ||
|
||
Specify extra functions to flag that act similarly to ``memcpy``. | ||
Specify names in a semicolon delimited list. | ||
Default is an empty string. | ||
The check will detect the following functions: | ||
`std::memcpy`, ``memcpy`, `std::memmove`, ``memmove``, ``std::strcpy``, | ||
``strcpy``, ``memccpy``, ``stpncpy``, ``strncpy``. | ||
|
||
.. option:: MemCmpNames | ||
|
||
Specify extra functions to flag that act similarly to ``memcmp``. | ||
Specify names in a semicolon delimited list. | ||
Default is an empty string. | ||
The check will detect the following functions: | ||
``std::memcmp``, ``memcmp``, ``std::strcmp``, ``strcmp``, ``strncmp``. | ||
|
||
This check corresponds to the CERT C++ Coding Standard rule | ||
`OOP57-CPP. Prefer special member functions and overloaded operators to C | ||
Standard Library functions | ||
<https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP57-CPP.+Prefer+special+member+functions+and+overloaded+operators+to+C+Standard+Library+functions>`_. |
40 changes: 5 additions & 35 deletions
40
clang-tools-extra/docs/clang-tidy/checks/cert/oop57-cpp.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,10 @@ | ||
.. title:: clang-tidy - cert-oop57-cpp | ||
.. meta:: | ||
:http-equiv=refresh: 5;URL=../bugprone/libc-memory-calls-on-nontrivial-types.html | ||
|
||
cert-oop57-cpp | ||
============== | ||
|
||
Flags use of the `C` standard library functions ``memset``, ``memcpy`` and | ||
``memcmp`` and similar derivatives on non-trivial types. | ||
|
||
Options | ||
------- | ||
|
||
.. option:: MemSetNames | ||
|
||
Specify extra functions to flag that act similarly to ``memset``. | ||
Specify names in a semicolon delimited list. | ||
Default is an empty string. | ||
The check will detect the following functions: | ||
`memset`, `std::memset`. | ||
|
||
.. option:: MemCpyNames | ||
|
||
Specify extra functions to flag that act similarly to ``memcpy``. | ||
Specify names in a semicolon delimited list. | ||
Default is an empty string. | ||
The check will detect the following functions: | ||
`std::memcpy`, `memcpy`, `std::memmove`, `memmove`, `std::strcpy`, | ||
`strcpy`, `memccpy`, `stpncpy`, `strncpy`. | ||
|
||
.. option:: MemCmpNames | ||
|
||
Specify extra functions to flag that act similarly to ``memcmp``. | ||
Specify names in a semicolon delimited list. | ||
Default is an empty string. | ||
The check will detect the following functions: | ||
`std::memcmp`, `memcmp`, `std::strcmp`, `strcmp`, `strncmp`. | ||
|
||
This check corresponds to the CERT C++ Coding Standard rule | ||
`OOP57-CPP. Prefer special member functions and overloaded operators to C | ||
Standard Library functions | ||
<https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP57-CPP.+Prefer+special+member+functions+and+overloaded+operators+to+C+Standard+Library+functions>`_. | ||
The cert-oop57-cpp check is an alias, please see | ||
`bugprone-libc-memory-calls-on-nontrivial-types <../bugprone/libc-memory-calls-on-nontrivial-types.html>`_ | ||
for more information. | ||
zwuis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
dvbuka marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...st/clang-tidy/checkers/cert/oop57-cpp.cpp → ...libc-memory-calls-on-nontrivial-types.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.