[Swan-dev] [Swan-commit] modularity erosion
D. Hugh Redelmeier
hugh at mimosa.com
Tue Feb 12 16:25:40 UTC 2019
commit 6909918af77cb8cc39bdad12c51543e16f8297a9
Author: Paul Wouters <pwouters at redhat.com>
Date: Mon Feb 11 19:26:40 2019 -0500
pluto: removal all but one include of proposals.h
Since connections.h needs it, and that is included everywhere else,
there is no need for separate includes.
If this becomes a trend, this is terrible.
In this particular case, it seems forced:
struct connection has:
struct ike_proposals ike_proposals;
struct child_proposals child_proposals;
so the compiler needs to know the size of those two structs when struct
connection is defined.
For v2, the problem is avoided by using struct pointers:
struct ikev2_proposals *v2_ike_proposals;
struct ikev2_proposals *v2_ike_auth_child_proposals;
struct ikev2_proposals *v2_create_child_proposals;
C allows struct pointers to be used without having a definition of the
struct "visible".
Perhaps the v1 code should follow the v2 code's approach.
I don't know if that would eliminate the need for connection.h including
proposals.h
More information about the Swan-dev
mailing list