[PATCH]: Enable positional arguments by default for Cygwin's printf

J. Johnston jjohnstn@redhat.com
Wed Nov 19 20:50:00 GMT 2003

Thanks Nicholas.  Patch checked in based on both Corinna's and Chris's approval.

-- Jeff J.

Nicholas Wourms wrote:
> Hi All,
> I posted a message to the Cygwin developers list asking if anyone had an
> objection to doing this.  Since noone expressed any, I think we should enable
> this since it will enhance our printf and improve compatibility w.r.t. sources
> from other *nixes.  As mentioned before in my message to the devel list, it
> also is specifed as a standard for Unix98.  However, I was required to fix what
> appeared to be a typo in vfprintf.c for %n when the argument is a long long.
> The pointer quad_ptr_t was already defined with the *, so the extra * after
> quad_ptr_t is extraneous and causes the CPP concatination to fail when
> positional args are enabled.
> In any event, after fixing that up, I sucessfully compiled the Cygwin dll.  I
> ran a few tests, including some portions of the glibc printf test.  The results
> were as expected and confirmed that positional arguments were functioning
> properly.  For reference, I have attached a small, working testcase to
> demonstrate postional arguments and prove they work on Cygwin.  Also attached
> is the patch adding -DWANT_IO_POS_ARGS to Cygwin's line in configure.host and
> fixing the aforementioned problem in vfprintf.c.
> Of course, this is up to Chris or Corinna to approve, so I await their
> comments/criticism.
> Cheers,
> Nicholas

More information about the Newlib mailing list