Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 8 Jun 2013 08:24:00 -0700
From: idunham@...abit.com
To: musl@...ts.openwall.com
Subject: Re: ether_* functions

On Fri, Jun 07, 2013 at 12:23:26PM -0400, Rich Felker wrote:
> Hi all,
> 
> The previous conversation about ether_aton/ntoa trailed off without
> really reaching a conclusion. I'd like to get these interfaces
> integrated for the next release. Does anyone have opinions on which
> version we should use: the think sscanf/snprintf wrappers (which I
> proposed), or the versions (by Strake) with all the logic inline that
> don't depend on other heavy functions?

I was about to say the thin wrappers because I want to avoid bloat
in libc.so and in programs that use both ether_* and *printf/sscanf,
but how much is the difference in ether_aton_r object size?

OK, let's test (Strake's last version vs Rich's scanf version, 
gcc 4.4 on Debian, musl from within the last couple weeks):
/tmp$ /opt/musl/bin/musl-gcc -std=c99 -D_XOPEN_SOURCE=700 -c 
ether_aton.c
/tmp$ /opt/musl/bin/musl-gcc -std=c99 -D_XOPEN_SOURCE=700 -c 
ether_aton_scanf.c 
/tmp$ size *.o
   text    data     bss     dec     hex filename
    161       0       6     167      a7 ether_aton.o
    182       0       0     182      b6 ether_aton_scanf.o
With -O3:
    328       0       0     328     148 ether_aton.o
    142       0       0     142      8e ether_aton_scanf.o
With -Os:
    101       0       0     101      65 ether_aton.o
    113       0       0     113      71 ether_aton_scanf.o

Huh? I'm wondering why scanf would be _larger_ with no -O and with 
-Os.

ether_ntoa is using sprintf already.

So I'll vote for Strake's version.

HTH,
Isaac Dunham

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.