org.sonar.l10n.oe.rules.rssw-oe.compiler.warning.2965.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-openedge-plugin Show documentation
Show all versions of sonar-openedge-plugin Show documentation
Enables analysis of OpenEdge projects
The newest version!
A preprocessor expression, such as would appear in an &IF or &ELSEIF, contained an element that was not a constant. Progress preprocessor expressions must consist solely of constants or of preprocessor names that expand to constants.
For example: &IF A < 3 &THEN ... is incorrect, because A is not a constant or a preprocessor reference that expands to a constant.
As the compiler will (almost) silently discard the entire code block in the &THEN or &ELSE block, this issue should absolutely be fixed
Please note that an issue in the OpenEdge compiler prevents this warning to be reported at the right line number. This is the case up to 11.7
Noncompliant Code Example
&SCOPED-DEFINE VAR1 xxx
&SCOPED-DEFINE VAR2 yyy
&IF {&VAR1} EQ {&VAR2} &THEN
// xxx and yyy are constants and can't be evaluated
&ENDIF
Compliant Solution
&SCOPED-DEFINE VAR1 xxx
&SCOPED-DEFINE VAR2 yyy
&IF "{&VAR1}" EQ "{&VAR2}" &THEN
// Comparison on string values
&ENDIF