该 pragma 会抑制某些警告。warning restore pragma 会使被抑制的信息重新激活。
语法 :
{warning disable <compiler ID>}
{warning restore <compiler ID>}
<compiler ID>:位于错误或警告信息开头的 ID。
示例
编译器信息:
typify code ... C0196: Implicit conversion from unsigned Type 'UINT' to signed Type 'INT' : possible change of sign Compile complete -- 0 errors
将 pragma 应用于变量声明:
VAR
{warning disable C0195}
test1 : UINT := -1;
{warning restore C0195}
test2 : UINT := -1;
END_VAR
test1 不会生成错误信息,test2 则会生成错误信息。