ellzey/libevhtp — Issue #12: Exposed structs are a recipe for pain
Author: nmathewson
Created: 2011-12-15 01:19:40+00:00
State: open

In Libevent, we learned the hard way that having exposed structures in a header file is practically begging for compatibility issues, as user code starts inspecting fields whose behavior or semantics changes in later versions; or as users start stack-allocating or mallocing something whose size changes; or as fields change their size and/or positions.

This makes it really hard to improve the implementation in the future without breaking user code, or to ever have a stable ABI.

So whenever possible, try to take structure declarations out of public headers. You'll be glad you did!