[
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314914#comment-17314914
]
Charles E. Rolke commented on DISPATCH-836:
-------------------------------------------
"_Dispatch likes the <> imports way too much"._
Indeed this is true to the point of being possibly behaving incorrectly. If
qpid-disptach is installed via an rpm package then one might reasonably expect
{code:java}
#include <qpid/dispatch/alloc.h>
{code}
to include the source alloc.h from the installed package. On the other hand one
might expect
{code:java}
#include "qpid/dispatch/alloc.h"
{code}
to include the source alloc.h from the current source tree.
In this case including the source file from the installed package is an error.
The source must be included from the current source tree or else the build
cannot be trusted.
Quoting the include file names instead of using angle brackets for files that
are part of the dispatch source would be a worthy addition to this jira.
Proton includes should be delimited with angle brackets. In the /src directory
all the includes already use the angle brackets so there is no change needed
there. In the /tests directory there are many instances of proton inclusions
with quoted file names and these should be changed.
> Source file organization suffers from include hell
> --------------------------------------------------
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
> Issue Type: Improvement
> Components: Container, Router Node, Routing Engine
> Affects Versions: 0.8.0
> Reporter: Charles E. Rolke
> Assignee: Jiri Daněk
> Priority: Minor
> Fix For: 1.16.0
>
>
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]