[LEDE-DEV] [PATCH] odhcp6c: Replace strerror(errno) with %m

Rosen Penev rosenp at gmail.com
Tue Jan 2 14:01:24 PST 2018


On Mon, Dec 25, 2017 at 3:23 PM, Florian Fainelli <f.fainelli at gmail.com> wrote:
> Le 12/25/17 à 15:05, Rosen Penev a écrit :
>> Reduction of 48 bytes in compiled size. No functional difference.
>>
>> -pedantic was removed as %m is a GNU extension.
>
> My 2 cents, I really think your patches are moving us in the wrong
> direction, even if all C libraries that are currently supported
> implement this extension, this is... a GNU extension, therefore, we
> should stay away from it.
>
As far as the general avoiding GNU extensions standpoint goes, I hold
no particular opinion.
As far as these %m patches go, BSDs such as macOS only print "m" when
given %m in a format string. Meaning, they help size in the common
case and hurt readability in the non-common case. I think this should
be determined on a case-by-case basis.
As far as odhcp6c goes, it's up to the maintainer.
> This was mentioned before, so I will repeat it here, OpenWrt/LEDE
> support building with external C libraries, I spent an enormous amount
> of time this year fixing problems discovered doing that, these type of
> changes clearly make these types of effort even more of a catch up game,
> which is already no fun.
>
> The size savings absolutely do not warrant making such changes across
> the board, the cost/reward is not just worth it. If you are so obsessed
> with size, I am sure we can find better ways to achieve that by
> generalizing the use of LTO or even re-linking programs with just what
> they need.
> --
> Florian



More information about the Lede-dev mailing list