属性:warning disable, warning restore
の warning disable 属性には、特定の警告を抑制する効果があります。の warning restore プラグマは抑制されたメッセージを再アクティブ化します。
この属性はすべてのコンパイラ警告に使用できます。すべてのコンパイラ警告のリストは、 CODESYS Development System プロジェクトのプロジェクト設定(プロジェクト → プロジェクト設定、 コンパイラの警告 カテゴリー)。
構文:
{warning disable <compiler ID>}
{warning restore <compiler ID>}
<compiler ID>:エラーまたは警告メッセージの先頭にあるID。
例 292. 例
コンパイラメッセージ:
typify code ... C0195: Implicit conversion from unsigned Type 'UINT' to signed Type 'INT' : possible change of sign Compile complete -- 0 errors
プラグマを変数宣言に適用する:
VAR
{warning disable C0195}
test1 : UINT := -1;
{warning restore C0195}
test2 : UINT := -1;
END_VARtest1 警告は生成されません。 test2 警告を生成します。