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

Cpp Core Check #627

Open
wants to merge 192 commits into
base: develop
Choose a base branch
from
Open

Cpp Core Check #627

wants to merge 192 commits into from

Conversation

srz-zumix
Copy link
Owner

@srz-zumix srz-zumix commented Nov 9, 2021

C++ Core Guidelines checkers

  • C26400: Do not assign the result of an allocation or a function call with an owner return value to a raw pointer, use owner instead (i.11).
  • C26401: Do not delete a raw pointer that is not an owner (i.11).
  • C26403: Reset or explicitly delete an owner pointer 'xxx' (r.3).
  • C26405: Do not assign to an owner which may be in valid state (r.3).
    • 26400,26403,26405 は RAII で解放を保証できるものは修正
    • それ以外は除外
  • C26409: Avoid calling new and delete explicitly, use std::make_unique instead (r.11).
    • C++03 対応のため対応が面倒なので対応しない
  • C26426: Global initializer calls a non-constexpr function 'XXX' (i.22).
    • 対応しないので除外
  • C26429: Symbol 'xxx' is never tested for nullness, it can be marked as not_null (f.23).
    • 許容するので警告は除外
  • C26432: If you define or delete any default operation in the type 'class XXX', define or delete them all (c.21).
    • メンドクサイので対応しない
  • C26435: Function 'XXX' should specify exactly one of 'virtual', 'override', or 'final' (c.128).
    • override がないころは virtual は override してますよという意図を示すのに使っていた
    • IUTEST_CXX_OVERRIDE マクロでその意図は示すことは可能だが変えることにメリットを感じないので除外する
  • C26434: Function 'YYY::XXX' hides a non-virtual function 'ZZZ::XXX'.
  • C26436: The type 'class YYY' with a virtual function needs either public virtual or protected non-virtual destructor (c.35).
  • C26440: Function 'XXX' can be declared 'noexcept' (f.6).
  • C26446: Prefer to use gsl::at() instead of unchecked subscript operator (bounds.4).
    • at が使えるところは変更
    • それ以外は gsl::at 相当のものを使用
  • C26447: The function is declared 'noexcept' but calls function 'XXX' which may throw exceptions (f.6).
    • ちゃんと直すことにする
  • C26455: Default constructor may not throw. Declare it 'noexcept' (f.6).
  • C26461: The pointer argument 'xxx' for function 'XXX' can be marked as a pointer to const (con.3).
  • C26466: Don't use static_cast downcasts. A cast from a polymorphic type should use dynamic_cast (type.2).
    • dynamic_cast は使わないので suppress
    • 設計の問題のヒントになりうるので警告は除外しない
  • C26472: Don't use a static_cast for arithmetic conversions. Use brace initialization, gsl::narrow_cast or gsl::narrow (type.1).
    • gsl::narrow 相当に対応したら消す
    • それまでは除外
  • C26473: Don't cast between pointer types where the source type and the target type are the same (type.1).
  • C26477: Use 'nullptr' rather than 0 or NULL (es.47).
    • テスト・サンプルソースは除外
  • C26481: Don't use pointer arithmetic. Use span instead (bounds.1).
  • C26482: Only index into arrays using constant expressions (bounds.2).
    • ignore
  • C26485: Expression 'func': No array to pointer decay (bounds.3).
  • C26492: Don't use const_cast to cast away const or volatile (type.3).
    • va_start が誤検知するのを抑止
  • C26493: Don't use C-style casts (type.4).
  • C26494: Variable 'XXX' is uninitialized. Always initialize an object (type.5).
  • C26495: Variable 'XXX::YYY' is uninitialized. Always initialize a member variable (type.6).
  • C26496: The variable 'XXX' does not change after construction, mark it as const (con.4).
  • C26497: You can attempt to make 'XXX' constexpr unless it contains any undefined behavior (f.4).
    • テスト・サンプルソースは除外
  • C26814: The const variable 'XXX' can be computed at compile-time. Consider using constexpr (con.5).
    • テスト・サンプルソースは除外
  • C26818: Switch statement does not cover all cases. Consider adding a 'default' label (es.79).
    • 誤検知だったので SUPPRESS
  • C26826: Don't use C-style variable arguments (f.55).
    • C++03 サポートするので対応しない。

include/internal/iutest_string.hpp Outdated Show resolved Hide resolved
include/internal/iutest_string.hpp Outdated Show resolved Hide resolved
include/internal/iutest_string.hpp Outdated Show resolved Hide resolved
include/internal/iutest_string.hpp Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2022

This pull request introduces 1 alert when merging 2321845 into f4c5ea9 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2022

This pull request introduces 1 alert when merging 25210ce into f4c5ea9 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Feb 17, 2022

This pull request introduces 1 alert when merging a5e5abe into a0cb0ff - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Mar 2, 2022

This pull request introduces 1 alert when merging 1fd1714 into e444f55 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

{
IUTEST_IGNORE_EXCEPTION_BEGIN()
{
Close();
Copy link

Choose a reason for hiding this comment

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

[Clang-Tidy] Call to virtual method 'StdioFile::Close' during destruction bypasses virtual dispatch (view)

Rule Severity
clang-analyzer-optin.cplusplus.VirtualCall warning

You can close this issue if no need to fix it. Learn more.

TestEnv::event_listeners().set_default_xml_generator(NULL);
IUTEST_IGNORE_EXCEPTION_BEGIN()
{
FileClose();
Copy link

Choose a reason for hiding this comment

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

[Clang-Tidy] Call to virtual method 'DefaultXmlGeneratorListener::FileClose' during destruction bypasses virtual dispatch (view)

Rule Severity
clang-analyzer-optin.cplusplus.VirtualCall warning

You can close this issue if no need to fix it. Learn more.

@lgtm-com
Copy link

lgtm-com bot commented Mar 11, 2022

This pull request introduces 1 alert when merging 065f8a9 into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Mar 13, 2022

This pull request introduces 1 alert when merging fd0b7b6 into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

tools/fused/fused_iutest_files.py Outdated Show resolved Hide resolved
tools/fused/fused_iutest_files.py Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Mar 13, 2022

This pull request introduces 1 alert when merging 28b9d8b into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Mar 14, 2022

This pull request introduces 1 alert when merging 3d4e800 into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Mar 14, 2022

This pull request introduces 1 alert when merging 040a078 into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Mar 14, 2022

This pull request introduces 1 alert when merging fa06eb6 into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Mar 15, 2022

This pull request introduces 1 alert when merging b18bed4 into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Mar 15, 2022

This pull request introduces 1 alert when merging 6ca5cc2 into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@lgtm-com
Copy link

lgtm-com bot commented Mar 16, 2022

This pull request introduces 1 alert when merging aeca0fb into e56ae1a - view on LGTM.com

new alerts:

  • 1 for FIXME comment

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.

1 participant