|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-03-06 09:37:01
Edward Diener wrote:
[...]
> Again John Maddock has used these #pragmas extensively in Regex++ to
> avoid data layout problems and I have used them in my libraries for
> the same reason, including my own components built on top of Regex++,
> and I have never encountered problems with them.
The issue is less clear-cut than you make it seem.
What we have here is a static library (Signals) that uses several
header-only libraries (shared_ptr, Function, maybe others.)
To "fix" the "alignment problem", we need not only #pragmify Signals, but
those other header-only libraries as well. Furthermore, we need to be
careful to not miss a header-only library that is used, directly or
indirectly, by Signals, or any other static library.
This impacts not only Signals users; it also affects those that only use
header libraries. They don't need the "fix", and some of them may
legitimately object to the binary compatibility settings that the headers
have inflicted on them, especially if these settings lead to slower or
larger code.
The alternative is simple: always build libraries and applications using the
_exact same_ settings. This is a good general advice, and it also applies to
settings that we cannot "fix" using the #pragma method.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net