Menu

#2449 osaf: Avoid conditional compilation when possible

future
assigned
None
enhancement
osaf
-
major
False
2019-07-23
2017-05-03
No

Related to ticket [#2448]. OpenSAF currently has a number of C preprocessor macros that control conditional compilation using #ifdef in the source code. This has a number of problems:

  • It makes testing more complex - we need to create one OpenSAF build for each possible combination of enabled/disabled macros and test each build.
  • ifdefs can confuse static code analysis tools - and humans as well.
  • This can make it impossible to choose at installation time which OpenSAF RPMs to install on the system, see ticket [#2448].

This ticket suggests that conditional compilation shall be removed when possible. One possible exception could be an OSAF_ENABLE_DEBUG macro that can create a separate debug build of OpenSAF. A debug build has some benefits for testing and trouble shooting but shouldn't be installed on a production system.

Related

Tickets: #2448

Discussion

  • Anders Widell

    Anders Widell - 2017-05-03
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,7 @@
     Related to ticket [#2448]. OpenSAF currently has a number of C preprocessor macros that control conditional compilation using #ifdef in the source code. This has a number of problems:
    
     * It makes testing more complex - we need to create one OpenSAF build for each possible combination of enabled/disabled macros and test each build.
    -* #ifdefs can confuse static code analysis tools - and humans as well.
    +* ifdefs can confuse static code analysis tools - and humans as well.
     * This can make it impossible to choose at installation time which OpenSAF RPMs to install on the system, see ticket [#2448].
    
     This ticket suggests that conditional compilation shall be removed when possible. One possible exception could be an OSAF_ENABLE_DEBUG macro that can create a separate debug build of OpenSAF. A debug build has some benefits for testing and trouble shooting but shouldn't be installed on a production system.
    
     

    Related

    Tickets: #2448

  • Anders Widell

    Anders Widell - 2017-07-01
    • Milestone: 5.17.08 --> 5.17.10
     
  • Anders Widell

    Anders Widell - 2017-10-30
    • Milestone: 5.17.10 --> 5.18.01
     
  • Anders Widell

    Anders Widell - 2018-02-02
    • Milestone: 5.18.01 --> 5.18.04
     
  • Anders Widell

    Anders Widell - 2018-04-20
    • Milestone: 5.18.04 --> 5.18.06
     
  • Gary Lee

    Gary Lee - 2018-06-29
    • Milestone: 5.18.06 --> 5.18.08
     
  • Gary Lee

    Gary Lee - 2018-09-29
    • Milestone: 5.18.09 --> 5.18.12
     
  • Gary Lee

    Gary Lee - 2019-01-09
    • Milestone: 5.19.01 --> 5.19.03
     
  • Gary Lee

    Gary Lee - 2019-03-26
    • Milestone: 5.19.03 --> 5.19.06
     
  • Gary Lee

    Gary Lee - 2019-07-23
    • Milestone: 5.19.07 --> future
     

Log in to post a comment.