C and C++


LANG.STRUCT.ELLIPSIS : 省略記号(...)の使用

要旨

関数定義に省略記号 (...)が使用されています。 (つまり、その関数は可変長引数関数と定義されます)。

プロパティ

クラス名 Ellipsis
日本語クラス名 省略記号(...)の使用
クラス分類 スタイル (style)
ニーモニック LANG.STRUCT.ELLIPSIS
カテゴリー
Misra2004 Misra2004:16.1 Functions shall not be defined with variable numbers of arguments
AUTOSARC++14 AUTOSARC++14:A8-4-1 Functions shall not be defined using the ellipsis notation.
MisraC++2008 MisraC++2008:8-4-1 Functions shall not be defined using the ellipsis notation.
MisraC++2023 MisraC++2023:8.2.11 An argument passed via ellipsis shall have an appropriate type
CWE CWE:1056 Invokable Control Element with Variadic Parameters
CERT-C CERT-C:DCL11-C Understand the type issues associated with variadic functions
CERT-CPP CERT-CPP:DCL50-CPP Do not define a C-style variadic function
JSF++ JSF++:108 Functions with variable numbers of arguments shall not be used.
JPL JPL:25 Use short functions with a limited number of parameters.
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Ellipsis"

int lang_struct_ellipsis(int a, int b, ...){  /* 'Ellipsis' warning issued here */
   return  a;                                 /* varargs do not need to be used for warning to be issued. */
}

int fixed_arity(int a, int b){                                    /* ok: no ellipsis */
   return  a;
}

int decl_only(int a, int b, ...);                                 /* ok: not a function definition */

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

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