Closed silvioprog closed 6 years ago
When you say "without informing [enabling?] any compiler optimization", that's a signal that your results aren't applicable to the real world. If you care about codegen size, you need to turn on -O3
, at which point you'll see the unused functions disappear.
[enabling?]
Yes.
that's a signal that your results aren't applicable to the real world
Even in debug mode? The libraries that allows to disable specific features allows less symbols at debugging time.
The examples you give from libcurl and microhttpd have nothing to do with debugging; they're locking down certain unsafe features for security reasons.
+1 Indeed. I tested enabling the compiler optimizations and the symbols disappears. Really makes no sense to add UTSTRING_FIND_DISABLED
.
Hello dudes.
Many GNU libraries allows to enable/disable any specific or extended features via building system to generate smaller libraries even disabling the compiler optimizations. For example, in
libcurl
building, you can do./configure --disable-cookies
before making it usingmake install
-- it will generate and install a smallerlibcurl
without cookies support; inlibmicrohttpd
, you can use./configure --disable-httpupgrade --disable-sendfile
beforemake install-strip
and it will generate/install the smallestlibmicrohttp
without HTTP-Upgrade/SendFile support. And so on.So, what do you think about to use this same approach in
utstring
? For example (noticeUTSTRING_FIND_DISABLED
):then a programmer could do:
or passing
-DUTSTRING_FIND_DISABLED=1
in their building system.I tested it in a library and the final generated static library was 17.8 kB using
UTSTRING_FIND_DISABLED 1
against 22.4 kB in original way, even without informing any compiler optimization.It would be very helpful a way to disable the
utstring-find
feature allowingutstring
to be used for who that just wants as a stream structure replacement.