Uploaded image for project: 'Qpid Dispatch'
  1. Qpid Dispatch
  2. DISPATCH-836

Source file organization suffers from include hell

    XMLWordPrintableJSON

Details

    Description

      Adding an innocent looking #include to some module may unleash a barrage of errors instead of simply defining the header's interface. Reordering and/or adding more #include statements is required to get it right.

      A good way to address this is to make certain that each module.h file compiles cleanly on its own. It is tedious and pretty unrewarding to check each file. One strategy to address this problem is for each module to #include module.h as the first include[1]. Then every compile checks that the module.h files compiles cleanly. This strategy is recommended by astitcher and used by qpid-cpp with great results.

      [1] One exception to this rule is including the #include Python.h ahead of all others. This is a requirement.

      Attachments

        Issue Links

          Activity

            People

              jdanek Jiri Daněk
              chug Charles E. Rolke
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: