[LEDE-DEV] [PATCH] odhcp6c: Replace strerror(errno) with %m
Hans Dedecker
dedeckeh at gmail.com
Wed Jan 3 02:04:01 PST 2018
On Tue, Jan 2, 2018 at 11:01 PM, Rosen Penev <rosenp at gmail.com> wrote:
> 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.
NAK for the patch as the code is intended to be used as "ISO C source" enforced
by the pedantic compile option which is removed in this patch. Adding
the pedantic
compile option results into the compiler warning "error: ISO C does
not support the '%m' gnu_printf format [-Werror=format=]"
which results into a compilation failure due to Werror.
Hans
>> 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
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
More information about the Lede-dev
mailing list