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
On 14/02/2022 20:25, Peter Dimov wrote: potentially
sensitive information into it (file and function names.)
Indeed.
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.
Given what you just agreed about above, shouldn't you flip the default i.e. BOOST_SYSTEM_ENABLE_CURRENT_FUNCTION. I also think you need a separate macro control for boost::system::error_code's use of source location, because it won't be unusual to want global source location function to be working but error_code's use of it to be globally disabled. Niall