This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix memory leak in printf_positional
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: "Carlos O'Donell" <carlos at redhat dot com>, Paul Eggert <eggert at cs dot ucla dot edu>, GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Wed, 2 Sep 2015 07:12:36 -0700
- Subject: Re: [PATCH] Fix memory leak in printf_positional
- Authentication-results: sourceware.org; auth=none
- References: <1440571295-20230-1-git-send-email-eggert at cs dot ucla dot edu> <alpine dot DEB dot 2 dot 10 dot 1508260930500 dot 26898 at digraph dot polyomino dot org dot uk> <55DFB7C7 dot 50307 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1508281350520 dot 5939 at digraph dot polyomino dot org dot uk> <55E06924 dot 2000209 at redhat dot com> <CALoOobMkGafD9zvq9g13TM8_Nd+HmC58_8gMGTQhdefXpko3CA at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1508311039110 dot 27932 at digraph dot polyomino dot org dot uk> <CALoOobO2iV9hPNB_S7PDoL=cWVCPrSkKGaUQfqboxUg40fsrVw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1509021004030 dot 3590 at digraph dot polyomino dot org dot uk>
On Wed, Sep 2, 2015 at 3:07 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 1 Sep 2015, Paul Pluzhnikov wrote:
> #define str1(x) #x
> #define str(x) str1(x)
> #define strc(a,b,c) str(a##b##c)
> #define e(x,y,z) "%"strc(x,y,z)"$s "
> #define f(x,y) e(x,y,0) e(x,y,1) e(x,y,2) e(x,y,3) e(x,y,4) e(x,y,5) e(x,y,6) e(x,y,7) e(x,y,8) e(x,y,9)
> #define g(x) f(x,0) f(x,1) f(x,2) f(x,3) f(x,4) f(x,5) f(x,6) f(x,7) f(x,8) f(x,9)
> g(0) g(1) g(2) g(3) g(4) g(5) g(6) g(7) g(8) g(9)
>
> (that example produces numbers with leading 0s, but you can produce
> numbers with 1, 2, 3 and 4 digits separately to avoid that).
I think at that point it becomes easier to just use a generator script
to write the test. Any objection to that?
Thanks,
--
Paul Pluzhnikov