JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
このワーニングは、スレッドエントリーポイント に該当する全ての箇所で検出されます。
このクラスは診断の目的で提供されており、コードの脆弱性とは関係ありません。このクラスを有効にすると、以下の場合に役立ちます。
シグナルハンドラのエントリーポイントに対しては、このクラスの代わりに シグナルハンドラエントリーポイント が検出されます。
| クラス名 | Thread Entry Point |
|---|---|
| 日本語クラス名 | スレッドエントリーポイント |
| クラス分類 | 診断 (diagnostic) |
| ニーモニック | DIAG.THREAD.ENTRY |
| カテゴリー | なし |
| 対応言語 | C および C++ で利用可能です。 |
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Thread Entry Point" このワーニングクラスは、コード内の問題に対する警告検出というより、診断解析を目的としています。 その為、通常はCodeSonarのpresetsで有効になることはありません。特に、all_warningclasses presetでさえも、有効にはなりませんことを留意して下さい。 |
#include <pthread.h>
static pthread_t thread;
void *entry(void *ctx){ return NULL; }
void reg(void* (*f)(void*))
{
pthread_create(&thread, NULL, f, NULL); /* Warning noting that entry is a thread entry point issued here */
}
void start()
{ reg(entry); }
Thread Entry Point warnings can be triggered by any function treated as a thread entry point function by CodeSonar:
このクラスが検出する関数は、CodeSonar がスレッドエントリーポイントとして認識する関数の部分集合であることに注意してください。 詳しくは Concurrency Models: スレッドエントリーポイント を参照してください。
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。