The check finds assignments of an integer to std::string:
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-integer-assignment.html
There are currently ten misc-string-integer-assignment warnings in mozilla-central, but they are all in third-party Breakpad code:
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:306:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:307:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:309:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:310:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:311:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:313:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:314:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:315:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc:316:17: warning: an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility
MozReview-Commit-ID: AUOyOuCzy1R
--HG--
extra : source : 93356b5c58539d19c27dade7b1514bae709bc149
extra : histedit_source : 4bc38ab5a7a50869aaf4fce87aa2f75ce9dd301a
Finds string constructors that are suspicious and probably errors. There are currently no misc-string-constructor warnings in mozilla-central!
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-constructor.html
MozReview-Commit-ID: LyJt6wqOhg9
--HG--
extra : source : 0b36b6b1b7931adec5846086a52080edb3ec5e7d
extra : histedit_source : 30249980b219d4813fc5503c87e84265ad354e2f
This check finds memset() calls with potential mistakes in their arguments. There are currently no bugprone-suspicious-memset-usage warnings in mozilla-central!
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-memset-usage.html
MozReview-Commit-ID: 9gmtidgMPwW
--HG--
extra : source : 9c6f6e1553c45751f476c2d8418b9d4735e27e50
extra : histedit_source : 721536e24babf3734e116bd6beaf8d43722cca96
Check for memory leaks, double free, and use-after-free and offset problems involving malloc. There are currently no clang-analyzer-unix.Malloc warnings in mozilla-central!
https://clang-analyzer.llvm.org/available_checks.html
MozReview-Commit-ID: G32SlokD64O
--HG--
extra : source : a2c8ccd2da1968b64510569f12f4631c54fea2d8
extra : histedit_source : b42c3ce2c3f8132fc0b301e6309b5ad25192167c
Check for null pointers being passed as arguments to C string functions. There are no clang-analyzer-unix.cstring.NullArg warnings in mozilla-central!
strlen
strnlen
strcpy
strncpy
strcat
strncat
strcmp
strncmp
strcasecmp
strncasecmp
https://clang-analyzer.llvm.org/available_checks.html
MozReview-Commit-ID: EkfaItfo5cu
--HG--
extra : source : e05c6cfa3b8ae6b3234ebf5e4895475bc623edcd
extra : histedit_source : 6aa97bb8d82884fb2ac92793df9defd7a7985e89
Check the size argument passed to strncat for common erroneous patterns. There are currently no clang-analyzer-unix.cstring.BadSizeArg warnings in mozilla-central!
https://clang-analyzer.llvm.org/available_checks.html
MozReview-Commit-ID: DUI3ZNIBoLQ
--HG--
extra : source : 8dafc73215cddd2737b4d8dbcb926521736d98c2
extra : histedit_source : ed27a98e47c01c9951c03eb2129ed4997f3cf624
This check finds unused namespace alias declarations. There are currently no misc-unused-alias-decls warnings in mozilla-central!
https://clang.llvm.org/extra/clang-tidy/checks/misc-unused-alias-decls.html
MozReview-Commit-ID: LHziGESvaM5
--HG--
extra : rebase_source : f10fbb6364bc947b5fa2ca8c0b47494519856940
extra : source : 987ca732290093c4bd36690c6ebd3ed2ac0b5444
This check finds potentially swapped function arguments by looking at implicit conversions. There are currently no misc-swapped-arguments warnings in mozilla-central!
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-swapped-arguments.html
MozReview-Commit-ID: 6SETUcQhQP
--HG--
extra : rebase_source : d364fc90e776807ab2540d714594d07a5a83b054
extra : source : 689980bf12e98780d0d60c851549d16a4cc8efb0
This check finds side effects from repeated macro arguments:
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-macro-repeated-side-effects.html
There are currently 16 misc-macro-repeated-side-effects warnings in mozilla-central, but they are all in third-party gfx/cairo code:
gfx/cairo/cairo/src/cairo-tor-scan-converter.c:1432:10: warning: side effects in the 1st macro argument 'x' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:1011:16: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:1037:16: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:1062:16: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:1088:16: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:1107:16: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:1126:27: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:1194:21: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:1258:16: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:600:28: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:629:28: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:660:28: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:690:28: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:721:28: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-access.c:986:16: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
gfx/cairo/libpixman/src/pixman-edge-imp.h:126:20: warning: side effects in the 2nd macro argument 'ptr' are repeated in macro expansion
MozReview-Commit-ID: CQ6iO9JO773
--HG--
extra : rebase_source : 0e7dc6fa3990ab187c597d8042a403c554152b02
extra : source : 5f47d400d53107df0e0478b369745bfd3f055702
Check for memory leaks. Traces memory managed by new/ delete. There are currently no clang-analyzer-cplusplus.NewDeleteLeaks warnings in mozilla-central!
https://clang-analyzer.llvm.org/available_checks.html
MozReview-Commit-ID: 3tmwR26UB8K
--HG--
extra : rebase_source : 3796cc6b61c03e83ce8b390e3342b870085b2ed2
extra : source : 3389fb54d2e3daee38db38503b37e9d994878bcd
Check for double-free, use-after-free and offset problems involving C++ delete. There are currently no clang-analyzer-cplusplus.NewDelete warnings in mozilla-central!
https://clang-analyzer.llvm.org/available_checks.html
MozReview-Commit-ID: 9sVp4fc4JTj
--HG--
extra : rebase_source : 733974ff07b873f6e5cd1e83104f82eafbf7f3c7
extra : source : 778684b276e6658fb9f3fa125aaec984cca8760a
It already had test files, but wasn't actually enabled. Also add a mock internal
std::string::find signature; two comments about disabled checks; and fix a typo.