|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2022-02-14 20:25:24
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#boost_current_location
This mirrors the behavior of the already existing
BOOST_DISABLE_CURRENT_FUNCTION, which has a similar purpose.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk