C and C++


LANG.ID.NU.LIBFN : ライブラリ関数のオーバーライド

要旨

ユーザーコード内で定義されたプロシージャが、プロジェクトのシステムインクルードヘッダー 内に宣言された関数名と同じ名前を有しています。このプロシージャとヘッダーは同じコンパイレーションユニット内 に有る必要性はありません。

システムヘッダーのステイタスは、コンフィグレーションファイル内にあるパラメータである SYSTEM_INCLUDE_PATHS.の設定にて決定されます。

プロパティ

クラス名 Library Function Override
日本語クラス名 ライブラリ関数のオーバーライド
クラス分類 セキュリティ (security)
ニーモニック LANG.ID.NU.LIBFN
カテゴリー
MisraC2023 MisraC2023:5.8 Identifiers that define objects or functions with external linkage shall be unique
  MisraC2023:5.9 Identifiers that define objects or functions with internal linkage should be unique
Misra2012 Misra2012:5.8 Identifiers that define objects or functions with external linkage shall be unique
  Misra2012:5.9 Identifiers that define objects or functions with internal linkage should be unique
Misra2004 Misra2004:5.7 No identifier name should be reused
AUTOSARC++14 AUTOSARC++14:A2-10-5 An identifier name of a function with static storage duration or a non-member object with external or internal linkage should not be reused.
  AUTOSARC++14:A17-0-1 Reserved identifiers, macros and functions in the C++ standard library shall not be defined, redefined or undefined.
MisraC++2008 MisraC++2008:2-10-5 The identifier name of a non-member object or function with static storage duration should not be reused.
  MisraC++2008:17-0-1 Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined.
CWE CWE:657 Violation of Secure Design Principles
  CWE:710 Improper Adherence to Coding Standards
  CWE:1076 Insufficient Adherence to Expected Conventions
CERT-C CERT-C:DCL23-C Guarantee that mutually visible identifiers are unique
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Library Function Override"

#include <math.h>

double fabs (double x){ /* 'Library Function Override' warning issued here */
  return x + 1;
}

関連のある設定ファイルパラメータ

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。