Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 1.01 KB

R6_AvoidLegacyControlFlow.md

File metadata and controls

33 lines (20 loc) · 1.01 KB

6. Avoid legacy control-flow constructs

Overview

Replace outdated and error-prone control-flow constructs with more robust and maintainable language features from recent standards, improving code maintainability and reducing the likelihood of bugs.

Checks

  • PWR063: Avoid using legacy Fortran constructs.

  • Planned: Use case or if-then-else constructs instead of go to statements for conditional flow.

  • Planned: Use do, cycle, and exit constructs instead of go to statements for loops.

  • Planned: Replace arithmetic if statements with block if constructs.

  • Planned: Convert numbered do loops to modern do loops.

  • Planned: End all loops with an end do statement.

  • Planned: Use only integer control variables in do loops.

  • Planned: Replace forall statements with do-concurrent constructs.

  • Planned: Avoid alternate return statements.

  • Planned: Replace compiler-dependant short-circuit logic with nested conditionals.