PointCloudLibrary / PointCloudLibrary/pcl

[Overview] Modernization code with clang-tidy

Open
#2,731 30 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind: todo
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

This issue is just to have an overview about clang-tidy modernizations.

Full list of clang-tidy checks.

Checks which redirect to another test are removed from following list.

Android:

  • android-cloexec-accept (Nothing found)
  • android-cloexec-accept4 (Nothing found)
  • android-cloexec-creat (Nothing found)
  • android-cloexec-dup (Nothing found)
  • android-cloexec-epoll-create (Nothing found)
  • android-cloexec-epoll-create1 (Nothing found)
  • android-cloexec-fopen (discussion: #2748, PR: #2755, #3223)
  • android-cloexec-inotify-init (Nothing found)
  • android-cloexec-inotify-init1 (Nothing found)
  • android-cloexec-memfd-create (Nothing found)
  • android-cloexec-open (discussion: #2748, PR: #2755)
  • android-cloexec-pipe (Nothing found)
  • android-cloexec-pipe2 (Nothing found)
  • android-cloexec-socket (Nothing found)
  • android-comparison-in-temp-failure-retry (Nothing found)

Boost:

  • boost-use-to-string (PR: #2785)

Bugprone:

  • bugprone-argument-comment (Nothing found)
  • bugprone-assert-side-effect (Nothing found)
  • bugprone-bool-pointer-implicit-conversion
  • bugprone-branch-clone (Nothing found)
  • bugprone-copy-constructor-init
  • bugprone-dangling-handle (Nothing found)
  • bugprone-exception-escape
  • bugprone-fold-init-type (Nothing found)
  • bugprone-forward-declaration-namespace
  • bugprone-forwarding-reference-overload (Nothing found)
  • bugprone-inaccurate-erase (Nothing found)
  • bugprone-incorrect-roundings
  • bugprone-integer-division
  • bugprone-lambda-function-name (Nothing found)
  • bugprone-macro-parentheses
  • bugprone-macro-repeated-side-effects (Nothing found)
  • bugprone-misplaced-operator-in-strlen-in-alloc (Nothing found)
  • bugprone-misplaced-widening-cast
  • bugprone-move-forwarding-reference (Nothing found)
  • bugprone-multiple-statement-macro
  • bugprone-narrowing-conversions
  • bugprone-parent-virtual-call
  • bugprone-posix-return (Nothing found)
  • bugprone-sizeof-container (Nothing found)
  • bugprone-sizeof-expression
  • bugprone-string-constructor (Nothing found)
  • bugprone-string-integer-assignment (Nothing found)
  • bugprone-string-literal-with-embedded-nul (Nothing found)
  • bugprone-suspicious-enum-usage
  • bugprone-suspicious-memset-usage (Nothing found)
  • bugprone-suspicious-missing-comma (Nothing found)
  • bugprone-suspicious-semicolon (Nothing found)
  • bugprone-suspicious-string-compare
  • bugprone-swapped-arguments (Nothing found)
  • bugprone-terminating-continue (Nothing found)
  • bugprone-throw-keyword-missing (Nothing found)
  • bugprone-too-small-loop-variable (PR: #2829)
  • bugprone-undefined-memory-manipulation
  • bugprone-undelegated-constructor (Nothing found)
  • bugprone-unhandled-self-assignment (Nothing found)
  • bugprone-unused-raii (Nothing found)
  • bugprone-unused-return-value (Nothing found)
  • bugprone-use-after-move (Nothing found)
  • bugprone-virtual-near-miss

Cert:

  • cert-dcl21-cpp
  • cert-dcl50-cpp
  • cert-dcl58-cpp (Nothing found)
  • cert-env33-c (Nothing found)
  • cert-err34-c
  • cert-err52-cpp
  • cert-err58-cpp
  • cert-err60-cpp
  • cert-flp30-c
  • cert-msc50-cpp
  • cert-msc51-cpp
  • cert-oop11-cp (Nothing found)

Clang-Analyzer:

  • clang-analyzer-apiModeling.StdCLibraryFunctions (Nothing found)
  • clang-analyzer-apiModeling.TrustNonnull (Nothing found)
  • clang-analyzer-apiModeling.google.GTest (Nothing found)
  • clang-analyzer-core.CallAndMessage
  • clang-analyzer-core.DivideZero
  • clang-analyzer-core.DynamicTypePropagation (Nothing found)
  • clang-analyzer-core.NonNullParamChecker
  • clang-analyzer-core.NonnilStringConstants (Nothing found)
  • clang-analyzer-core.NullDereference
  • clang-analyzer-core.StackAddressEscape (Nothing found)
  • clang-analyzer-core.UndefinedBinaryOperatorResult (Nothing found)
  • clang-analyzer-core.VLASize (Nothing found)
  • clang-analyzer-core.builtin.BuiltinFunctions (Nothing found)
  • clang-analyzer-core.builtin.NoReturnFunctions (Nothing found)
  • clang-analyzer-core.uninitialized.ArraySubscript
  • clang-analyzer-core.uninitialized.Assign
  • clang-analyzer-core.uninitialized.Branch
  • clang-analyzer-core.uninitialized.CapturedBlockVariable (Nothing found)
  • clang-analyzer-core.uninitialized.UndefReturn
  • clang-analyzer-cplusplus.InnerPointer (Nothing found)
  • clang-analyzer-cplusplus.Move (Nothing found)
  • clang-analyzer-cplusplus.NewDelete
  • clang-analyzer-cplusplus.NewDeleteLeaks
  • clang-analyzer-cplusplus.SelfAssignment (Nothing found)
  • clang-analyzer-deadcode.DeadStores (PR: #3095)
  • clang-analyzer-llvm.Conventions (check not released in a stable version of clang-tidy)
  • clang-analyzer-nullability.NullPassedToNonnull (Nothing found)
  • clang-analyzer-nullability.NullReturnedFromNonnull (Nothing found)
  • clang-analyzer-nullability.NullableDereferenced (Nothing found)
  • clang-analyzer-nullability.NullablePassedToNonnull (Nothing found)
  • clang-analyzer-nullability.NullableReturnedFromNonnull (Nothing found)
  • clang-analyzer-optin.cplusplus.VirtualCall
  • clang-analyzer-optin.mpi.MPI-Checker (Nothing found)
  • clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker (Nothing found)
  • clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker (Nothing found)
  • clang-analyzer-optin.performance.GCDAntipattern (Nothing found)
  • clang-analyzer-optin.performance.Padding
  • clang-analyzer-optin.portability.UnixAPI (Nothing found)
  • clang-analyzer-osx.API (Nothing found)
  • clang-analyzer-osx.NumberObjectConversion (Nothing found)
  • clang-analyzer-osx.OSObjectRetainCount (Nothing found)
  • clang-analyzer-osx.ObjCProperty (Nothing found)
  • clang-analyzer-osx.SecKeychainAPI (Nothing found)
  • clang-analyzer-osx.cocoa.AtSync (Nothing found)
  • clang-analyzer-osx.cocoa.AutoreleaseWrite (Nothing found)
  • clang-analyzer-osx.cocoa.ClassRelease (Nothing found)
  • clang-analyzer-osx.cocoa.Dealloc (Nothing found)
  • clang-analyzer-osx.cocoa.IncompatibleMethodTypes (Nothing found)
  • clang-analyzer-osx.cocoa.Loops (Nothing found)
  • clang-analyzer-osx.cocoa.MissingSuperCall (Nothing found)
  • clang-analyzer-osx.cocoa.NSAutoreleasePool (Nothing found)
  • clang-analyzer-osx.cocoa.NSError (Nothing found)
  • clang-analyzer-osx.cocoa.NilArg (Nothing found)
  • clang-analyzer-osx.cocoa.NonNilReturnValue (Nothing found)
  • clang-analyzer-osx.cocoa.ObjCGenerics (Nothing found)
  • clang-analyzer-osx.cocoa.RetainCount (Nothing found)
  • clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak (Nothing found)
  • clang-analyzer-osx.cocoa.SelfInit (Nothing found)
  • clang-analyzer-osx.cocoa.SuperDealloc (Nothing found)
  • clang-analyzer-osx.cocoa.UnusedIvars (Nothing found)
  • clang-analyzer-osx.cocoa.VariadicMethodTypes (Nothing found)
  • clang-analyzer-osx.coreFoundation.CFError (Nothing found)
  • clang-analyzer-osx.coreFoundation.CFNumber (Nothing found)
  • clang-analyzer-osx.coreFoundation.CFRetainRelease (Nothing found)
  • clang-analyzer-osx.coreFoundation.containers.OutOfBounds (Nothing found)
  • clang-analyzer-osx.coreFoundation.containers.PointerSizedValues (Nothing found)
  • clang-analyzer-security.FloatLoopCounter
  • clang-analyzer-security.insecureAPI.UncheckedReturn (Nothing found)
  • clang-analyzer-security.insecureAPI.bcmp (Nothing found)
  • clang-analyzer-security.insecureAPI.bcopy (Nothing found)
  • clang-analyzer-security.insecureAPI.bzero (Nothing found)
  • clang-analyzer-security.insecureAPI.getpw (Nothing found)
  • clang-analyzer-security.insecureAPI.gets (Nothing found)
  • clang-analyzer-security.insecureAPI.mkstemp (Nothing found)
  • clang-analyzer-security.insecureAPI.mktemp (Nothing found)
  • clang-analyzer-security.insecureAPI.rand (Nothing found)
  • clang-analyzer-security.insecureAPI.strcpy
  • clang-analyzer-security.insecureAPI.vfork (Nothing found)
  • clang-analyzer-unix.API
  • clang-analyzer-unix.Malloc
  • clang-analyzer-unix.MallocSizeof (Nothing found)
  • clang-analyzer-unix.MismatchedDeallocator
  • clang-analyzer-unix.StdCLibraryFunctions (check not released in a stable version of clang-tidy)
  • clang-analyzer-unix.Vfork (Nothing found)
  • clang-analyzer-unix.cstring.BadSizeArg (Nothing found)
  • clang-analyzer-unix.cstring.NullArg (Nothing found)
  • clang-analyzer-valist.CopyToSelf (Nothing found)
  • clang-analyzer-valist.Uninitialized (Nothing found)
  • clang-analyzer-valist.Unterminated (Nothing found)

cppcoreguidelines

  • cppcoreguidelines-avoid-goto
  • cppcoreguidelines-interfaces-global-init (Nothing found)
  • cppcoreguidelines-macro-usage
  • cppcoreguidelines-narrowing-conversions
  • cppcoreguidelines-no-malloc
  • cppcoreguidelines-owning-memory
  • cppcoreguidelines-pro-bounds-array-to-pointer-decay
  • cppcoreguidelines-pro-bounds-constant-array-index
  • cppcoreguidelines-pro-bounds-pointer-arithmetic
  • cppcoreguidelines-pro-type-const-cast
  • cppcoreguidelines-pro-type-cstyle-cast
  • cppcoreguidelines-pro-type-member-init
  • cppcoreguidelines-pro-type-reinterpret-cast
  • cppcoreguidelines-pro-type-static-cast-downcast
  • cppcoreguidelines-pro-type-union-access
  • cppcoreguidelines-pro-type-vararg
  • cppcoreguidelines-slicing
  • cppcoreguidelines-special-member-functions

hicpp:

  • hicpp-avoid-goto
  • hicpp-exception-baseclass
  • hicpp-multiway-paths-covered
  • hicpp-no-assembler (Nothing found)
  • hicpp-signed-bitwise

Misc:

  • misc-definitions-in-headers
  • misc-misplaced-const
  • misc-new-delete-overloads (Nothing found)
  • misc-non-copyable-objects (Nothing found)
  • misc-non-private-member-variables-in-classes
  • misc-redundant-expression
  • misc-static-assert (Nothing found)
  • misc-throw-by-value-catch-by-reference (Nothing found)
  • misc-unconventional-assign-operator
  • misc-uniqueptr-reset-release (Nothing found)
  • misc-unused-alias-decls (Nothing found)
  • misc-unused-parameters
  • misc-unused-using-decls

Modernize:

  • modernize-avoid-bind (Nothing found)
  • modernize-avoid-c-arrays (PR: #4489)
  • modernize-concat-nested-namespaces (requires C++17)
  • modernize-deprecated-headers (PR: #2737)
  • modernize-deprecated-ios-base-aliases
  • modernize-loop-convert (PR: #2835, #2836, #2837, #2838, #2839, #2840, #2841, #2842, #2843, #2844, #2844, #2845, #2846, #2847, #2848, #2849, #2850, #2851, #2853, #2854, #2855, #2856, #2857, #2858, #2859, #2860)
  • modernize-make-shared (Nothing found)
  • modernize-make-unique (Nothing found)
  • modernize-pass-by-value
  • modernize-raw-string-literal (PR: #2789)
  • modernize-redundant-void-arg (PR: #2780)
  • modernize-replace-auto-ptr (Nothing found)
  • modernize-replace-random-shuffle (PR: #3069)
  • modernize-return-braced-init-list (PR: #3039)
  • modernize-shrink-to-fit (Nothing found)
  • modernize-unary-static-assert (requires C++17)
  • modernize-use-auto (developer decision, so no auto transformation, see discussion in #2838)
  • modernize-use-bool-literals (PR: #2793)
  • modernize-use-default-member-init
  • modernize-use-emplace (PR: #2784)
  • modernize-use-equals-default (PR: #5386)
  • modernize-use-equals-delete (PR: #2779)
  • modernize-use-nodiscard (requires C++17)
  • modernize-use-noexcept
  • modernize-use-nullptr (PR: #3004, #3005, #3006, #3007, #3008, #3009, #3010, #3011, #3012, #3013, #3014, #3015, #3016, #3017, #3018, #3019, #3020, #3021, #3022, #3023, #3024, #3025, #3026, #3027, #3028, #3029)
  • modernize-use-override (PR: #2728)
  • modernize-use-trailing-return-type (check not released in a stable version of clang-tidy)
  • modernize-use-transparent-functors (PR: #3224)
  • modernize-use-uncaught-exceptions (requires C++17)
  • modernize-use-using (PR: #3112, #3113, #3115, #3117, #3118, #3121, #3122, #3123, #3124, #3125, #3129, #3130, #3132, #3134, #3137, #3138, #3139)

MPI

  • mpi-buffer-deref (Nothing found)
  • mpi-type-mismatch (Nothing found)

OpenMP

  • openmp-exception-escape (Nothing found)
  • openmp-use-default-none (PR: #3524)

Performance

  • performance-faster-string-find (PR: #2794)
  • performance-for-range-copy (Nothing found)
  • performance-implicit-conversion-in-loop (requires #3234)
  • performance-inefficient-algorithm (Nothing found)
  • performance-inefficient-string-concatenation (discussion: #3233)
  • performance-inefficient-vector-operation (Nothing found)
  • performance-move-const-arg (Nothing found)
  • performance-move-constructor-init (Nothing found)
  • performance-noexcept-move-constructor (Nothing found)
  • performance-type-promotion-in-math-fn (PR: #3087)
  • performance-unnecessary-copy-initialization
  • performance-unnecessary-value-param (PR: #3232, #3253)

Readability:

  • readability-avoid-const-params-in-decls
  • readability-braces-around-statements
  • readability-const-return-type
  • readability-container-size-empty (PR: #3033)
  • readability-delete-null-pointer (PR: #2990)
  • readability-deleted-default (Nothing found)
  • readability-else-after-return (PR: #3180, #3181, #3182, #3183, #3184, #3185, #3186)
  • readability-function-size
  • readability-identifier-naming (Nothing found)
  • readability-implicit-bool-conversion
  • readability-inconsistent-declaration-parameter-name
  • readability-isolate-declaration
  • readability-magic-numbers
  • readability-make-member-function-const (PR: #3836)
  • readability-misleading-indentation
  • readability-misplaced-array-index (Nothing found)
  • readability-named-parameter
  • readability-non-const-parameter
  • readability-redundant-control-flow
  • readability-redundant-declaration (Nothing found)
  • readability-redundant-function-ptr-dereference (Nothing found)
  • readability-redundant-member-init (PR: #3070)
  • readability-redundant-preprocessor (Nothing found)
  • readability-redundant-smartptr-get (Nothing found)
  • readability-redundant-string-cstr (PR: #3517)
  • readability-redundant-string-init (PR: #2758)
  • readability-simplify-boolean-expr (PR: #2790)
  • readability-simplify-subscript-expr
  • readability-static-accessed-through-instance (PR: #2776)
  • readability-static-definition-in-anonymous-namespace (Nothing found)
  • readability-string-compare (PR: #2986)
  • readability-uniqueptr-delete-release (Nothing found)
  • readability-uppercase-literal-suffix

Not relevant checks:

  • abseil-*
  • fuchsia-*
  • google-*
  • llvm-*
  • objc-*
  • portability-simd-intrinsics (experimental part of std)
  • zircon-*

In case you see a modernization we could apply or can't apply, feel free to write it as comment. In case there is a modernization that needs discussion, open a new issue and write reference to it as comment, so I can add it to this list.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the clang-tidy checks list linked in the issue and review the unchecked checks in the modernization overview. No source files or tests are named, so determine the relevant code and validation for one selected check before making changes; done would require completing that modernization and updating the checklist.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.