-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Description
I did this
A libcurl compiled with --disable-verbose still includes trace logging strings in its binary that are never used, bloating the binary size.
I expected the following
Trace strings should not be included in the binary. This happens because in --disable-verbose mode the macros (e.g. CURL_TRC_CF are not nulled-out but rather the functions (e.g. Curl_trc_cf_infof) that those macros call are set to empty bodies. The compiler then keeps the strings in order to pass them to the empty functions that immediately return.
It appears to me that the intent was to compile away most of the trace subsystem in the CURL_DISABLE_VERBOSE_STRINGS case, so the right fix would seem to replace those macros instead of keeping empty functions around. The trace functions aren't part of the external API and are always called through those macros so this appears safe. If there are side effects in those macros calls this will break, but I hope that nobody is using the trace macros that way.
curl/libcurl version
8.19.0-DEV
operating system
Linux