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

Update clang-tidy rules; Add clang diagnostics #1566

Merged

Conversation

ivangalkin
Copy link
Contributor

@ivangalkin ivangalkin commented Oct 5, 2018

addresses #1560
fixes #1548

TODO

  • check if rule-IDs in clang-tidy report match the rule-IDs in the clangtidy.xml

New rules:

  • clang-diagnostic-#pragma-messages
  • clang-diagnostic-#warnings
  • clang-diagnostic-CFString-literal
  • clang-diagnostic-CL4
  • clang-diagnostic-IndependentClass-attribute
  • clang-diagnostic-NSObject-attribute
  • clang-diagnostic-absolute-value
  • clang-diagnostic-abstract-final-class
  • clang-diagnostic-abstract-vbase-init
  • clang-diagnostic-address
  • clang-diagnostic-address-of-packed-member
  • clang-diagnostic-address-of-temporary
  • clang-diagnostic-all
  • clang-diagnostic-alloca-with-align-alignof
  • clang-diagnostic-ambiguous-delete
  • clang-diagnostic-ambiguous-ellipsis
  • clang-diagnostic-ambiguous-macro
  • clang-diagnostic-ambiguous-member-template
  • clang-diagnostic-analyzer-incompatible-plugin
  • clang-diagnostic-anonymous-pack-parens
  • clang-diagnostic-arc
  • clang-diagnostic-arc-bridge-casts-disallowed-in-nonarc
  • clang-diagnostic-arc-maybe-repeated-use-of-weak
  • clang-diagnostic-arc-non-pod-memaccess
  • clang-diagnostic-arc-performSelector-leaks
  • clang-diagnostic-arc-repeated-use-of-weak
  • clang-diagnostic-arc-retain-cycles
  • clang-diagnostic-arc-unsafe-retained-assign
  • clang-diagnostic-argument-outside-range
  • clang-diagnostic-array-bounds
  • clang-diagnostic-array-bounds-pointer-arithmetic
  • clang-diagnostic-asm
  • clang-diagnostic-asm-ignored-qualifier
  • clang-diagnostic-asm-operand-widths
  • clang-diagnostic-assign-enum
  • clang-diagnostic-assume
  • clang-diagnostic-atimport-in-framework-header
  • clang-diagnostic-atomic-alignment
  • clang-diagnostic-atomic-implicit-seq-cst
  • clang-diagnostic-atomic-memory-ordering
  • clang-diagnostic-atomic-properties
  • clang-diagnostic-atomic-property-with-user-defined-accessor
  • clang-diagnostic-attribute-packed-for-bitfield
  • clang-diagnostic-attributes
  • clang-diagnostic-auto-disable-vptr-sanitizer
  • clang-diagnostic-auto-import
  • clang-diagnostic-auto-storage-class
  • clang-diagnostic-auto-var-id
  • clang-diagnostic-availability
  • clang-diagnostic-backend-plugin
  • clang-diagnostic-backslash-newline-escape
  • clang-diagnostic-bad-function-cast
  • clang-diagnostic-binary-literal
  • clang-diagnostic-bind-to-temporary-copy
  • clang-diagnostic-binding-in-condition
  • clang-diagnostic-bitfield-constant-conversion
  • clang-diagnostic-bitfield-enum-conversion
  • clang-diagnostic-bitfield-width
  • clang-diagnostic-bitwise-op-parentheses
  • clang-diagnostic-block-capture-autoreleasing
  • clang-diagnostic-bool-conversion
  • clang-diagnostic-bool-conversions
  • clang-diagnostic-braced-scalar-init
  • clang-diagnostic-bridge-cast
  • clang-diagnostic-builtin-macro-redefined
  • clang-diagnostic-builtin-memcpy-chk-size
  • clang-diagnostic-builtin-requires-header
  • clang-diagnostic-c++-compat
  • clang-diagnostic-c++0x-compat
  • clang-diagnostic-c++0x-extensions
  • clang-diagnostic-c++0x-narrowing
  • clang-diagnostic-c++11-compat
  • clang-diagnostic-c++11-compat-deprecated-writable-strings
  • clang-diagnostic-c++11-compat-pedantic
  • clang-diagnostic-c++11-compat-reserved-user-defined-literal
  • clang-diagnostic-c++11-extensions
  • clang-diagnostic-c++11-extra-semi
  • clang-diagnostic-c++11-inline-namespace
  • clang-diagnostic-c++11-long-long
  • clang-diagnostic-c++11-narrowing
  • clang-diagnostic-c++14-binary-literal
  • clang-diagnostic-c++14-compat
  • clang-diagnostic-c++14-compat-pedantic
  • clang-diagnostic-c++14-extensions
  • clang-diagnostic-c++17-compat
  • clang-diagnostic-c++17-compat-mangling
  • clang-diagnostic-c++17-compat-pedantic
  • clang-diagnostic-c++17-extensions
  • clang-diagnostic-c++1y-extensions
  • clang-diagnostic-c++1z-compat
  • clang-diagnostic-c++1z-compat-mangling
  • clang-diagnostic-c++1z-extensions
  • clang-diagnostic-c++2a-compat
  • clang-diagnostic-c++2a-compat-pedantic
  • clang-diagnostic-c++2a-extensions
  • clang-diagnostic-c++98-c++11-c++14-c++17-compat
  • clang-diagnostic-c++98-c++11-c++14-c++17-compat-pedantic
  • clang-diagnostic-c++98-c++11-c++14-compat
  • clang-diagnostic-c++98-c++11-c++14-compat-pedantic
  • clang-diagnostic-c++98-c++11-compat
  • clang-diagnostic-c++98-c++11-compat-binary-literal
  • clang-diagnostic-c++98-c++11-compat-pedantic
  • clang-diagnostic-c++98-compat
  • clang-diagnostic-c++98-compat-bind-to-temporary-copy
  • clang-diagnostic-c++98-compat-extra-semi
  • clang-diagnostic-c++98-compat-local-type-template-args
  • clang-diagnostic-c++98-compat-pedantic
  • clang-diagnostic-c++98-compat-unnamed-type-template-args
  • clang-diagnostic-c11-extensions
  • clang-diagnostic-c99-compat
  • clang-diagnostic-c99-extensions
  • clang-diagnostic-cast-align
  • clang-diagnostic-cast-calling-convention
  • clang-diagnostic-cast-of-sel-type
  • clang-diagnostic-cast-qual
  • clang-diagnostic-cast-qual-unrelated
  • clang-diagnostic-char-subscripts
  • clang-diagnostic-clang-cl-pch
  • clang-diagnostic-class-varargs
  • clang-diagnostic-comma
  • clang-diagnostic-comment
  • clang-diagnostic-comments
  • clang-diagnostic-compare-distinct-pointer-types
  • clang-diagnostic-complex-component-init
  • clang-diagnostic-conditional-type-mismatch
  • clang-diagnostic-conditional-uninitialized
  • clang-diagnostic-config-macros
  • clang-diagnostic-constant-conversion
  • clang-diagnostic-constant-logical-operand
  • clang-diagnostic-constexpr-not-const
  • clang-diagnostic-consumed
  • clang-diagnostic-conversion
  • clang-diagnostic-conversion-null
  • clang-diagnostic-coroutine
  • clang-diagnostic-coroutine-missing-unhandled-exception
  • clang-diagnostic-covered-switch-default
  • clang-diagnostic-cpp
  • clang-diagnostic-cstring-format-directive
  • clang-diagnostic-cuda-compat
  • clang-diagnostic-custom-atomic-properties
  • clang-diagnostic-dangling
  • clang-diagnostic-dangling-else
  • clang-diagnostic-dangling-field
  • clang-diagnostic-dangling-initializer-list
  • clang-diagnostic-date-time
  • clang-diagnostic-dealloc-in-category
  • clang-diagnostic-debug-compression-unavailable
  • clang-diagnostic-declaration-after-statement
  • clang-diagnostic-defaulted-function-deleted
  • clang-diagnostic-delegating-ctor-cycles
  • clang-diagnostic-delete-incomplete
  • clang-diagnostic-delete-non-virtual-dtor
  • clang-diagnostic-deprecated
  • clang-diagnostic-deprecated-attributes
  • clang-diagnostic-deprecated-declarations
  • clang-diagnostic-deprecated-dynamic-exception-spec
  • clang-diagnostic-deprecated-implementations
  • clang-diagnostic-deprecated-increment-bool
  • clang-diagnostic-deprecated-objc-isa-usage
  • clang-diagnostic-deprecated-objc-pointer-introspection
  • clang-diagnostic-deprecated-objc-pointer-introspection-performSelector
  • clang-diagnostic-deprecated-register
  • clang-diagnostic-deprecated-this-capture
  • clang-diagnostic-deprecated-writable-strings
  • clang-diagnostic-direct-ivar-access
  • clang-diagnostic-disabled-macro-expansion
  • clang-diagnostic-distributed-object-modifiers
  • clang-diagnostic-div-by-zero
  • clang-diagnostic-division-by-zero
  • clang-diagnostic-dll-attribute-on-redeclaration
  • clang-diagnostic-dllexport-explicit-instantiation-decl
  • clang-diagnostic-dllimport-static-field-def
  • clang-diagnostic-documentation
  • clang-diagnostic-documentation-deprecated-sync
  • clang-diagnostic-documentation-html
  • clang-diagnostic-documentation-pedantic
  • clang-diagnostic-documentation-unknown-command
  • clang-diagnostic-dollar-in-identifier-extension
  • clang-diagnostic-double-promotion
  • clang-diagnostic-duplicate-decl-specifier
  • clang-diagnostic-duplicate-enum
  • clang-diagnostic-duplicate-method-arg
  • clang-diagnostic-duplicate-method-match
  • clang-diagnostic-duplicate-protocol
  • clang-diagnostic-dynamic-class-memaccess
  • clang-diagnostic-dynamic-exception-spec
  • clang-diagnostic-effc++
  • clang-diagnostic-embedded-directive
  • clang-diagnostic-empty-body
  • clang-diagnostic-empty-decomposition
  • clang-diagnostic-empty-translation-unit
  • clang-diagnostic-encode-type
  • clang-diagnostic-endif-labels
  • clang-diagnostic-enum-compare
  • clang-diagnostic-enum-compare-switch
  • clang-diagnostic-enum-conversion
  • clang-diagnostic-enum-too-large
  • clang-diagnostic-exceptions
  • clang-diagnostic-exit-time-destructors
  • clang-diagnostic-expansion-to-defined
  • clang-diagnostic-experimental-isel
  • clang-diagnostic-explicit-initialize-call
  • clang-diagnostic-explicit-ownership-type
  • clang-diagnostic-extern-c-compat
  • clang-diagnostic-extern-initializer
  • clang-diagnostic-extra
  • clang-diagnostic-extra-qualification
  • clang-diagnostic-extra-semi
  • clang-diagnostic-extra-tokens
  • clang-diagnostic-fallback
  • clang-diagnostic-fixed-enum-extension
  • clang-diagnostic-flag-enum
  • clang-diagnostic-flexible-array-extensions
  • clang-diagnostic-float-conversion
  • clang-diagnostic-float-equal
  • clang-diagnostic-float-overflow-conversion
  • clang-diagnostic-float-zero-conversion
  • clang-diagnostic-for-loop-analysis
  • clang-diagnostic-format
  • clang-diagnostic-format-extra-args
  • clang-diagnostic-format-invalid-specifier
  • clang-diagnostic-format-non-iso
  • clang-diagnostic-format-nonliteral
  • clang-diagnostic-format-pedantic
  • clang-diagnostic-format-security
  • clang-diagnostic-format-zero-length
  • clang-diagnostic-format=2
  • clang-diagnostic-four-char-constants
  • clang-diagnostic-frame-larger-than=
  • clang-diagnostic-framework-include-private-from-public
  • clang-diagnostic-function-def-in-objc-container
  • clang-diagnostic-function-multiversion
  • clang-diagnostic-gcc-compat
  • clang-diagnostic-global-constructors
  • clang-diagnostic-gnu
  • clang-diagnostic-gnu-alignof-expression
  • clang-diagnostic-gnu-anonymous-struct
  • clang-diagnostic-gnu-array-member-paren-init
  • clang-diagnostic-gnu-auto-type
  • clang-diagnostic-gnu-binary-literal
  • clang-diagnostic-gnu-case-range
  • clang-diagnostic-gnu-complex-integer
  • clang-diagnostic-gnu-compound-literal-initializer
  • clang-diagnostic-gnu-conditional-omitted-operand
  • clang-diagnostic-gnu-designator
  • clang-diagnostic-gnu-empty-initializer
  • clang-diagnostic-gnu-empty-struct
  • clang-diagnostic-gnu-flexible-array-initializer
  • clang-diagnostic-gnu-flexible-array-union-member
  • clang-diagnostic-gnu-folding-constant
  • clang-diagnostic-gnu-imaginary-constant
  • clang-diagnostic-gnu-include-next
  • clang-diagnostic-gnu-label-as-value
  • clang-diagnostic-gnu-redeclared-enum
  • clang-diagnostic-gnu-statement-expression
  • clang-diagnostic-gnu-static-float-init
  • clang-diagnostic-gnu-string-literal-operator-template
  • clang-diagnostic-gnu-union-cast
  • clang-diagnostic-gnu-variable-sized-type-not-at-end
  • clang-diagnostic-gnu-zero-line-directive
  • clang-diagnostic-gnu-zero-variadic-macro-arguments
  • clang-diagnostic-header-guard
  • clang-diagnostic-header-hygiene
  • clang-diagnostic-idiomatic-parentheses
  • clang-diagnostic-ignored-attributes
  • clang-diagnostic-ignored-optimization-argument
  • clang-diagnostic-ignored-pragma-intrinsic
  • clang-diagnostic-ignored-pragma-optimize
  • clang-diagnostic-ignored-pragmas
  • clang-diagnostic-ignored-qualifiers
  • clang-diagnostic-implicit
  • clang-diagnostic-implicit-atomic-properties
  • clang-diagnostic-implicit-conversion-floating-point-to-bool
  • clang-diagnostic-implicit-exception-spec-mismatch
  • clang-diagnostic-implicit-fallthrough
  • clang-diagnostic-implicit-fallthrough-per-function
  • clang-diagnostic-implicit-function-declaration
  • clang-diagnostic-implicit-int
  • clang-diagnostic-implicit-retain-self
  • clang-diagnostic-implicitly-unsigned-literal
  • clang-diagnostic-import-preprocessor-directive-pedantic
  • clang-diagnostic-inaccessible-base
  • clang-diagnostic-include-next-absolute-path
  • clang-diagnostic-include-next-outside-header
  • clang-diagnostic-incompatible-exception-spec
  • clang-diagnostic-incompatible-function-pointer-types
  • clang-diagnostic-incompatible-library-redeclaration
  • clang-diagnostic-incompatible-ms-struct
  • clang-diagnostic-incompatible-pointer-types
  • clang-diagnostic-incompatible-pointer-types-discards-qualifiers
  • clang-diagnostic-incompatible-property-type
  • clang-diagnostic-incompatible-sysroot
  • clang-diagnostic-incomplete-framework-module-declaration
  • clang-diagnostic-incomplete-implementation
  • clang-diagnostic-incomplete-module
  • clang-diagnostic-incomplete-umbrella
  • clang-diagnostic-inconsistent-dllimport
  • clang-diagnostic-inconsistent-missing-destructor-override
  • clang-diagnostic-inconsistent-missing-override
  • clang-diagnostic-increment-bool
  • clang-diagnostic-infinite-recursion
  • clang-diagnostic-initializer-overrides
  • clang-diagnostic-injected-class-name
  • clang-diagnostic-inline-asm
  • clang-diagnostic-inline-new-delete
  • clang-diagnostic-instantiation-after-specialization
  • clang-diagnostic-int-conversion
  • clang-diagnostic-int-conversions
  • clang-diagnostic-int-to-pointer-cast
  • clang-diagnostic-int-to-void-pointer-cast
  • clang-diagnostic-integer-overflow
  • clang-diagnostic-invalid-command-line-argument
  • clang-diagnostic-invalid-constexpr
  • clang-diagnostic-invalid-iboutlet
  • clang-diagnostic-invalid-initializer-from-system-header
  • clang-diagnostic-invalid-ios-deployment-target
  • clang-diagnostic-invalid-noreturn
  • clang-diagnostic-invalid-offsetof
  • clang-diagnostic-invalid-or-nonexistent-directory
  • clang-diagnostic-invalid-partial-specialization
  • clang-diagnostic-invalid-pp-token
  • clang-diagnostic-invalid-source-encoding
  • clang-diagnostic-invalid-token-paste
  • clang-diagnostic-jump-seh-finally
  • clang-diagnostic-keyword-compat
  • clang-diagnostic-keyword-macro
  • clang-diagnostic-knr-promoted-parameter
  • clang-diagnostic-language-extension-token
  • clang-diagnostic-large-by-value-copy
  • clang-diagnostic-literal-conversion
  • clang-diagnostic-literal-range
  • clang-diagnostic-local-type-template-args
  • clang-diagnostic-logical-not-parentheses
  • clang-diagnostic-logical-op-parentheses
  • clang-diagnostic-long-long
  • clang-diagnostic-loop-analysis
  • clang-diagnostic-macro-redefined
  • clang-diagnostic-main
  • clang-diagnostic-main-return-type
  • clang-diagnostic-malformed-warning-check
  • clang-diagnostic-many-braces-around-scalar-init
  • clang-diagnostic-max-unsigned-zero
  • clang-diagnostic-memset-transposed-args
  • clang-diagnostic-memsize-comparison
  • clang-diagnostic-method-signatures
  • clang-diagnostic-microsoft
  • clang-diagnostic-microsoft-anon-tag
  • clang-diagnostic-microsoft-cast
  • clang-diagnostic-microsoft-charize
  • clang-diagnostic-microsoft-comment-paste
  • clang-diagnostic-microsoft-const-init
  • clang-diagnostic-microsoft-cpp-macro
  • clang-diagnostic-microsoft-default-arg-redefinition
  • clang-diagnostic-microsoft-end-of-file
  • clang-diagnostic-microsoft-enum-forward-reference
  • clang-diagnostic-microsoft-enum-value
  • clang-diagnostic-microsoft-exception-spec
  • clang-diagnostic-microsoft-exists
  • clang-diagnostic-microsoft-explicit-constructor-call
  • clang-diagnostic-microsoft-extra-qualification
  • clang-diagnostic-microsoft-fixed-enum
  • clang-diagnostic-microsoft-flexible-array
  • clang-diagnostic-microsoft-goto
  • clang-diagnostic-microsoft-inaccessible-base
  • clang-diagnostic-microsoft-include
  • clang-diagnostic-microsoft-mutable-reference
  • clang-diagnostic-microsoft-pure-definition
  • clang-diagnostic-microsoft-redeclare-static
  • clang-diagnostic-microsoft-sealed
  • clang-diagnostic-microsoft-template
  • clang-diagnostic-microsoft-union-member-reference
  • clang-diagnostic-microsoft-unqualified-friend
  • clang-diagnostic-microsoft-using-decl
  • clang-diagnostic-microsoft-void-pseudo-dtor
  • clang-diagnostic-mismatched-new-delete
  • clang-diagnostic-mismatched-parameter-types
  • clang-diagnostic-mismatched-return-types
  • clang-diagnostic-mismatched-tags
  • clang-diagnostic-missing-braces
  • clang-diagnostic-missing-declarations
  • clang-diagnostic-missing-exception-spec
  • clang-diagnostic-missing-field-initializers
  • clang-diagnostic-missing-method-return-type
  • clang-diagnostic-missing-noescape
  • clang-diagnostic-missing-noreturn
  • clang-diagnostic-missing-prototype-for-cc
  • clang-diagnostic-missing-prototypes
  • clang-diagnostic-missing-selector-name
  • clang-diagnostic-missing-sysroot
  • clang-diagnostic-missing-variable-declarations
  • clang-diagnostic-module-build
  • clang-diagnostic-module-conflict
  • clang-diagnostic-module-file-config-mismatch
  • clang-diagnostic-module-file-extension
  • clang-diagnostic-module-import-in-extern-c
  • clang-diagnostic-modules-ambiguous-internal-linkage
  • clang-diagnostic-modules-import-nested-redundant
  • clang-diagnostic-most
  • clang-diagnostic-move
  • clang-diagnostic-msvc-include
  • clang-diagnostic-msvc-not-found
  • clang-diagnostic-multichar
  • clang-diagnostic-multiple-move-vbase
  • clang-diagnostic-narrowing
  • clang-diagnostic-nested-anon-types
  • clang-diagnostic-new-returns-null
  • clang-diagnostic-newline-eof
  • clang-diagnostic-noexcept-type
  • clang-diagnostic-non-gcc
  • clang-diagnostic-non-literal-null-conversion
  • clang-diagnostic-non-modular-include-in-framework-module
  • clang-diagnostic-non-modular-include-in-module
  • clang-diagnostic-non-pod-varargs
  • clang-diagnostic-non-virtual-dtor
  • clang-diagnostic-nonnull
  • clang-diagnostic-nonportable-include-path
  • clang-diagnostic-nonportable-system-include-path
  • clang-diagnostic-nonportable-vector-initialization
  • clang-diagnostic-nontrivial-memaccess
  • clang-diagnostic-nsconsumed-mismatch
  • clang-diagnostic-nsreturns-mismatch
  • clang-diagnostic-null-arithmetic
  • clang-diagnostic-null-character
  • clang-diagnostic-null-conversion
  • clang-diagnostic-null-dereference
  • clang-diagnostic-null-pointer-arithmetic
  • clang-diagnostic-nullability
  • clang-diagnostic-nullability-completeness
  • clang-diagnostic-nullability-completeness-on-arrays
  • clang-diagnostic-nullability-declspec
  • clang-diagnostic-nullability-extension
  • clang-diagnostic-nullability-inferred-on-nested-type
  • clang-diagnostic-nullable-to-nonnull-conversion
  • clang-diagnostic-objc-autosynthesis-property-ivar-name-match
  • clang-diagnostic-objc-circular-container
  • clang-diagnostic-objc-cocoa-api
  • clang-diagnostic-objc-designated-initializers
  • clang-diagnostic-objc-flexible-array
  • clang-diagnostic-objc-forward-class-redefinition
  • clang-diagnostic-objc-interface-ivars
  • clang-diagnostic-objc-literal-compare
  • clang-diagnostic-objc-literal-conversion
  • clang-diagnostic-objc-macro-redefinition
  • clang-diagnostic-objc-messaging-id
  • clang-diagnostic-objc-method-access
  • clang-diagnostic-objc-missing-property-synthesis
  • clang-diagnostic-objc-missing-super-calls
  • clang-diagnostic-objc-multiple-method-names
  • clang-diagnostic-objc-noncopy-retain-block-property
  • clang-diagnostic-objc-nonunified-exceptions
  • clang-diagnostic-objc-property-assign-on-object-type
  • clang-diagnostic-objc-property-implementation
  • clang-diagnostic-objc-property-implicit-mismatch
  • clang-diagnostic-objc-property-matches-cocoa-ownership-rule
  • clang-diagnostic-objc-property-no-attribute
  • clang-diagnostic-objc-property-synthesis
  • clang-diagnostic-objc-protocol-method-implementation
  • clang-diagnostic-objc-protocol-property-synthesis
  • clang-diagnostic-objc-protocol-qualifiers
  • clang-diagnostic-objc-readonly-with-setter-property
  • clang-diagnostic-objc-redundant-api-use
  • clang-diagnostic-objc-redundant-literal-use
  • clang-diagnostic-objc-root-class
  • clang-diagnostic-objc-string-compare
  • clang-diagnostic-objc-string-concatenation
  • clang-diagnostic-objc-unsafe-perform-selector
  • clang-diagnostic-odr
  • clang-diagnostic-old-style-cast
  • clang-diagnostic-opencl-unsupported-rgba
  • clang-diagnostic-openmp-clauses
  • clang-diagnostic-openmp-loop-form
  • clang-diagnostic-openmp-target
  • clang-diagnostic-option-ignored
  • clang-diagnostic-ordered-compare-function-pointers
  • clang-diagnostic-out-of-line-declaration
  • clang-diagnostic-out-of-scope-function
  • clang-diagnostic-over-aligned
  • clang-diagnostic-overlength-strings
  • clang-diagnostic-overloaded-shift-op-parentheses
  • clang-diagnostic-overloaded-virtual
  • clang-diagnostic-override-module
  • clang-diagnostic-overriding-method-mismatch
  • clang-diagnostic-overriding-t-option
  • clang-diagnostic-packed
  • clang-diagnostic-padded
  • clang-diagnostic-parentheses
  • clang-diagnostic-parentheses-equality
  • clang-diagnostic-partial-availability
  • clang-diagnostic-pass
  • clang-diagnostic-pass-analysis
  • clang-diagnostic-pass-failed
  • clang-diagnostic-pass-missed
  • clang-diagnostic-pch-date-time
  • clang-diagnostic-pedantic-core-features
  • clang-diagnostic-pessimizing-move
  • clang-diagnostic-pointer-arith
  • clang-diagnostic-pointer-bool-conversion
  • clang-diagnostic-pointer-sign
  • clang-diagnostic-pointer-type-mismatch
  • clang-diagnostic-potentially-evaluated-expression
  • clang-diagnostic-pragma-clang-attribute
  • clang-diagnostic-pragma-once-outside-header
  • clang-diagnostic-pragma-pack
  • clang-diagnostic-pragma-pack-suspicious-include
  • clang-diagnostic-pragma-system-header-outside-header
  • clang-diagnostic-pragmas
  • clang-diagnostic-predefined-identifier-outside-function
  • clang-diagnostic-private-extern
  • clang-diagnostic-private-header
  • clang-diagnostic-private-module
  • clang-diagnostic-profile-instr-missing
  • clang-diagnostic-profile-instr-out-of-date
  • clang-diagnostic-profile-instr-unprofiled
  • clang-diagnostic-property-access-dot-syntax
  • clang-diagnostic-property-attribute-mismatch
  • clang-diagnostic-protocol
  • clang-diagnostic-protocol-property-synthesis-ambiguity
  • clang-diagnostic-qualified-void-return-type
  • clang-diagnostic-quoted-include-in-framework-header
  • clang-diagnostic-range-loop-analysis
  • clang-diagnostic-readonly-iboutlet-property
  • clang-diagnostic-receiver-expr
  • clang-diagnostic-receiver-forward-class
  • clang-diagnostic-redeclared-class-member
  • clang-diagnostic-redundant-move
  • clang-diagnostic-redundant-parens
  • clang-diagnostic-register
  • clang-diagnostic-reinterpret-base-class
  • clang-diagnostic-remark-backend-plugin
  • clang-diagnostic-reorder
  • clang-diagnostic-requires-super-attribute
  • clang-diagnostic-reserved-id-macro
  • clang-diagnostic-reserved-user-defined-literal
  • clang-diagnostic-retained-language-linkage
  • clang-diagnostic-return-stack-address
  • clang-diagnostic-return-std-move
  • clang-diagnostic-return-std-move-in-c++11
  • clang-diagnostic-return-type
  • clang-diagnostic-return-type-c-linkage
  • clang-diagnostic-sanitize-address
  • clang-diagnostic-section
  • clang-diagnostic-selector
  • clang-diagnostic-selector-type-mismatch
  • clang-diagnostic-self-assign
  • clang-diagnostic-self-assign-field
  • clang-diagnostic-self-assign-overloaded
  • clang-diagnostic-self-move
  • clang-diagnostic-semicolon-before-method-body
  • clang-diagnostic-sentinel
  • clang-diagnostic-sequence-point
  • clang-diagnostic-serialized-diagnostics
  • clang-diagnostic-shadow
  • clang-diagnostic-shadow-all
  • clang-diagnostic-shadow-field
  • clang-diagnostic-shadow-field-in-constructor
  • clang-diagnostic-shadow-field-in-constructor-modified
  • clang-diagnostic-shadow-ivar
  • clang-diagnostic-shadow-uncaptured-local
  • clang-diagnostic-shift-count-negative
  • clang-diagnostic-shift-count-overflow
  • clang-diagnostic-shift-negative-value
  • clang-diagnostic-shift-op-parentheses
  • clang-diagnostic-shift-overflow
  • clang-diagnostic-shift-sign-overflow
  • clang-diagnostic-shorten-64-to-32
  • clang-diagnostic-sign-compare
  • clang-diagnostic-sign-conversion
  • clang-diagnostic-signed-enum-bitfield
  • clang-diagnostic-sizeof-array-argument
  • clang-diagnostic-sizeof-array-decay
  • clang-diagnostic-sizeof-pointer-memaccess
  • clang-diagnostic-slash-u-filename
  • clang-diagnostic-sometimes-uninitialized
  • clang-diagnostic-source-uses-openmp
  • clang-diagnostic-spir-compat
  • clang-diagnostic-static-float-init
  • clang-diagnostic-static-in-inline
  • clang-diagnostic-static-inline-explicit-instantiation
  • clang-diagnostic-static-local-in-inline
  • clang-diagnostic-static-self-init
  • clang-diagnostic-stdlibcxx-not-found
  • clang-diagnostic-strict-prototypes
  • clang-diagnostic-strict-selector-match
  • clang-diagnostic-string-compare
  • clang-diagnostic-string-conversion
  • clang-diagnostic-string-plus-char
  • clang-diagnostic-string-plus-int
  • clang-diagnostic-strlcpy-strlcat-size
  • clang-diagnostic-strncat-size
  • clang-diagnostic-super-class-method-mismatch
  • clang-diagnostic-suspicious-bzero
  • clang-diagnostic-suspicious-memaccess
  • clang-diagnostic-switch
  • clang-diagnostic-switch-bool
  • clang-diagnostic-switch-enum
  • clang-diagnostic-sync-fetch-and-nand-semantics-changed
  • clang-diagnostic-tautological-compare
  • clang-diagnostic-tautological-constant-compare
  • clang-diagnostic-tautological-constant-in-range-compare
  • clang-diagnostic-tautological-constant-out-of-range-compare
  • clang-diagnostic-tautological-overlap-compare
  • clang-diagnostic-tautological-pointer-compare
  • clang-diagnostic-tautological-type-limit-compare
  • clang-diagnostic-tautological-undefined-compare
  • clang-diagnostic-tautological-unsigned-enum-zero-compare
  • clang-diagnostic-tautological-unsigned-zero-compare
  • clang-diagnostic-tentative-definition-incomplete-type
  • clang-diagnostic-thread-safety
  • clang-diagnostic-thread-safety-analysis
  • clang-diagnostic-thread-safety-attributes
  • clang-diagnostic-thread-safety-beta
  • clang-diagnostic-thread-safety-negative
  • clang-diagnostic-thread-safety-precise
  • clang-diagnostic-thread-safety-reference
  • clang-diagnostic-thread-safety-verbose
  • clang-diagnostic-trigraphs
  • clang-diagnostic-type-safety
  • clang-diagnostic-typedef-redefinition
  • clang-diagnostic-typename-missing
  • clang-diagnostic-unable-to-open-stats-file
  • clang-diagnostic-unavailable-declarations
  • clang-diagnostic-undeclared-selector
  • clang-diagnostic-undef
  • clang-diagnostic-undefined-bool-conversion
  • clang-diagnostic-undefined-func-template
  • clang-diagnostic-undefined-inline
  • clang-diagnostic-undefined-internal
  • clang-diagnostic-undefined-internal-type
  • clang-diagnostic-undefined-reinterpret-cast
  • clang-diagnostic-undefined-var-template
  • clang-diagnostic-unevaluated-expression
  • clang-diagnostic-unguarded-availability
  • clang-diagnostic-unguarded-availability-new
  • clang-diagnostic-unicode
  • clang-diagnostic-unicode-homoglyph
  • clang-diagnostic-unicode-whitespace
  • clang-diagnostic-unicode-zero-width
  • clang-diagnostic-uninitialized
  • clang-diagnostic-unknown-argument
  • clang-diagnostic-unknown-attributes
  • clang-diagnostic-unknown-escape-sequence
  • clang-diagnostic-unknown-pragmas
  • clang-diagnostic-unknown-sanitizers
  • clang-diagnostic-unknown-warning-option
  • clang-diagnostic-unnamed-type-template-args
  • clang-diagnostic-unneeded-internal-declaration
  • clang-diagnostic-unneeded-member-function
  • clang-diagnostic-unreachable-code
  • clang-diagnostic-unreachable-code-aggressive
  • clang-diagnostic-unreachable-code-break
  • clang-diagnostic-unreachable-code-loop-increment
  • clang-diagnostic-unreachable-code-return
  • clang-diagnostic-unsequenced
  • clang-diagnostic-unsupported-abs
  • clang-diagnostic-unsupported-availability-guard
  • clang-diagnostic-unsupported-cb
  • clang-diagnostic-unsupported-dll-base-class-template
  • clang-diagnostic-unsupported-friend
  • clang-diagnostic-unsupported-gpopt
  • clang-diagnostic-unsupported-nan
  • clang-diagnostic-unsupported-target-opt
  • clang-diagnostic-unsupported-visibility
  • clang-diagnostic-unusable-partial-specialization
  • clang-diagnostic-unused
  • clang-diagnostic-unused-command-line-argument
  • clang-diagnostic-unused-comparison
  • clang-diagnostic-unused-const-variable
  • clang-diagnostic-unused-exception-parameter
  • clang-diagnostic-unused-function
  • clang-diagnostic-unused-getter-return-value
  • clang-diagnostic-unused-label
  • clang-diagnostic-unused-lambda-capture
  • clang-diagnostic-unused-local-typedef
  • clang-diagnostic-unused-local-typedefs
  • clang-diagnostic-unused-macros
  • clang-diagnostic-unused-member-function
  • clang-diagnostic-unused-parameter
  • clang-diagnostic-unused-private-field
  • clang-diagnostic-unused-property-ivar
  • clang-diagnostic-unused-result
  • clang-diagnostic-unused-template
  • clang-diagnostic-unused-value
  • clang-diagnostic-unused-variable
  • clang-diagnostic-unused-volatile-lvalue
  • clang-diagnostic-used-but-marked-unused
  • clang-diagnostic-user-defined-literals
  • clang-diagnostic-user-defined-warnings
  • clang-diagnostic-varargs
  • clang-diagnostic-variadic-macros
  • clang-diagnostic-vec-elem-size
  • clang-diagnostic-vector-conversion
  • clang-diagnostic-vector-conversions
  • clang-diagnostic-vexing-parse
  • clang-diagnostic-visibility
  • clang-diagnostic-vla
  • clang-diagnostic-vla-extension
  • clang-diagnostic-void-ptr-dereference
  • clang-diagnostic-weak-template-vtables
  • clang-diagnostic-weak-vtables
  • clang-diagnostic-writable-strings
  • clang-diagnostic-write-strings
  • clang-diagnostic-zero-as-null-pointer-constant
  • clang-diagnostic-zero-length-array

This change is Reviewable

addresses SonarOpenCommunity#1560
fixes SonarOpenCommunity#1548

* gnerate JSON file from Diagnositc.td
  `llvm-tblgen -dump-json <src_dir>/tools/clang/include/clang/Basic/Diagnostic.td > output.json`
* parse JSON in order to generate rules ( incl. types, severities and descriptions)
* the result is identical to http://clang.llvm.org/docs/DiagnosticsReference.html

TODO
* check if prefix 'clang-diagnostics-' applies to all diagnositcs
* check if rule-IDs in clang-tidy report match the rule-IDs in the clangtidy.xml
@ivangalkin
Copy link
Contributor Author

@ALL: please review
@sigiesec: I figured out a reliable way to generate the documentation by means of llvm-tblgen; the rules contain a full-fledged documentation (at least it's very similar to http://clang.llvm.org/docs/DiagnosticsReference.html). Please review and/or try it on your installation https://ci.appveyor.com/project/SonarOpenCommunity/sonar-cxx/build/artifacts
@nathanaelg I would appreciate if you could take a look at the rules, too

thank you

@ivangalkin
Copy link
Contributor Author

@sigiesec did you have a chance to look into this PR or apply the snapshot build? Thank you in advance.

@guwirth
Copy link
Collaborator

guwirth commented Oct 17, 2018

No feedback is good feedback :-)

@guwirth guwirth merged commit 493013a into SonarOpenCommunity:master Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Custom rules limited to 4000 chars
2 participants