Niall Douglas wrote:
On 13/02/2022 21:43, Peter Dimov via Boost wrote:
Recommendation two: add source locations to your error_codes if using Boost.System.
That seems unwise advice to give unqualified. Every time you instance a source location you add the path of your source file to your binary, which bloats your binary.
That's correct. In addition to bloating the binary, it also embeds potentially sensitive information into it (file and function names.) The macro BOOST_DISABLE_CURRENT_LOCATION, when defined, makes BOOST_CURRENT_LOCATION resolve to a default-constructed boost::source_location, which stores nothing except empty strings. See https://www.boost.org/doc/libs/develop/libs/assert/doc/html/assert.html#boos... This mirrors the behavior of the already existing BOOST_DISABLE_CURRENT_FUNCTION, which has a similar purpose.