禁用警告指令可用于停止警告信息-警告恢复指令用于恢复警告信息的显示。
句法:
{warning disable <compiler ID>}
编译器生成的每个警告和每个报错都拥有一个唯一的ID,在描述的开始均有显示。
编译器消息例子
------ Build started: Application: Device.Application ------- typify code ... C0196: 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_VAR
在 test2上的例子将产生一个警告。 test1 则不会。