This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix memory leak in printf_positional


On Sat, Sep 12, 2015 at 12:16 PM, Martin Sebor <msebor@gmail.com> wrote:

> I see the test disables optimization to work around the GCC issue
> but I wonder if a better solution might be to create an array object
> for the format string rather than passing it as a literal to printf.

You mean like this:

  char fmt[] = "%$1s %$2s ...";
  printf(fmt, "a", "a", ...);

If so, no: the format literal is not what triggers the the GCC problem
-- the number of arguments being passed to printf does.

-- 
Paul Pluzhnikov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]