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.2p0 | CONFIDENTIAL | CodeSecure Inc |
The code contains a throw expression.
| クラス名 | Use of throw | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | Use of throw | ||||||||||||||||||||||||
| クラス分類 | スタイル (style) | ||||||||||||||||||||||||
| ニーモニック | LANG.STRUCT.EXCP.THROW | ||||||||||||||||||||||||
| カテゴリー |
|
||||||||||||||||||||||||
| 対応言語 | C++ のみ利用可能です。 C は利用できません。 |
||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Use of throw" |
#include <stdexcept> bool has_logic_error(void); void f_exception_spec(void) // This exception specification will cause an error in some compilers, such as C++17 compilers. // We guard it with "#ifdef __CODESONAR__ ... #endif" so that it // is preprocessed out by the native compiler (so the example can be compiled) // but still observed by the CodeSonar analysis. #ifdef __CODESONAR__ throw(std::exception) // ok: this is an exception specification, // not a throw statement. #endif ; void f_throw_stmt(void){ if (has_logic_error()){ throw std::logic_error("Logic error."); // 'Use of throw' warning issued here. } }
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。
To report problems with this documentation, please visit https://support.codesecure.com/.