Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 05 Apr 2014 16:37:49 +0200
From: Jens Gustedt <>
Subject: Re: build with clang-3.4 warnings report

Am Samstag, den 05.04.2014, 09:07 -0400 schrieb Rich Felker:
> On Sat, Apr 05, 2014 at 11:04:58AM +0200, Jens Gustedt wrote:
> > The whole thing could be avoided by using designated initializers and
> > eliminating the whole errid array right away. Designated initializers
> > should be present in all decent versions of gcc. Do you want me to
> > prepare a patch?
> No, this is not about avoiding features but rather not adding a whole
> page (or two pages, on 64-bit machines) of non-sharable pseudo-data to
>, or the same amount of text to nearly every static-linked
> program.

I experimented a bit, and I get

 - +20 bytes more for the simplest version, replacing the positon
   array by an array with sizes of the strings and a good reduction in
   complexity of the function

 - +40 to +60 bytes extra code size for some trivial error and bounds
   checking (which only can do good, here)

 - +100 bytes when replacing the "unsigned char" array with the sizes
   by an "unsigned short" array that holds all the offsets of the
   strings and reduces the function itself mainly to a table lookup.

(all that on x86_64 and only compile tested for them moment)

So this is largely below the one page threshold (increasing code size
from 3200 byte to 3360 at the worst), and the generated assembler
looks quite clean.


:: INRIA Nancy Grand Est ::   ::
:: AlGorille ::::::::::::::: office Nancy : +33 383593090   ::
:: ICube :::::::::::::: office Strasbourg : +33 368854536   ::
:: ::::::::::::::::::::::::::: gsm France : +33 651400183   ::
:: :::::::::::::::::::: gsm international : +49 15737185122 ::

Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

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.