Skip to main content

SA0164: Multiline comments

Detects multiline comments which are coded as (* comment *). Only single-line comments which are coded as // comment are permitted.

Justification: Some programming guidelines prohibit multiline comments in code because the beginning and end of a comment could get lost and the closing comment bracket could be deleted by accident.

Tip

You can deactivate this check by means of the pragma analysis, also for comments in the declaration part.

Importance: Low

PLCopen rule: C5

Example 121. Example
{attribute 'do-analysis'}
(*
    This is a multi-line comment    // SA0164
*)
PROGRAM PLC_PRG
VAR
// This is a single line comment
    a: DINT;
END_VAR
(* This is not a single line comment *)    // SA0164
a := a + 1;

Output in the Messages view:

  • sa_icon_message.png SA0164: Use single line comments only