[PATCH]: Fix printf positional arguments breakage

Jeff Johnston jjohnstn@redhat.com
Mon Mar 21 22:36:00 GMT 2005

Patch checked in.  Thanks.

-- Jeff J.

Nicholas Wourms wrote:
> Hi,
> It looks like the move of certain defines from the command line (-DXXXX) to newlib.h has resulted in postional argument support being disabled even when it is explicitly enabled.  The problem is that vprintf.c is expecting that _WANT_IO_POS_ARGS would be defined on the command line, thus it put the #ifdef test before including newlib.h.  IMHO, I find the usage of preprocessor conditionals in newlib to be excessive, almost to the point of being gratuitous.  I also think that putting conditionals before includes is a bad idea, in general.  Be that as it may, I have attached a fix which rectifies the issue at hand.  In addition, I removed a redundant include of reent.h.  However, it might be a good idea to review the other defines moved from the command line to newlib.h, to be sure that this problem isn't silently manifesting itself elsewhere.
> Cheers,
> Nicholas
> __________________________________________________________________
> Switch to Netscape Internet Service.
> As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
> Netscape. Just the Net You Need.
> New! Netscape Toolbar for Internet Explorer
> Search from anywhere on the Web and block those annoying pop-ups.
> Download now at http://channels.netscape.com/ns/search/install.jsp

More information about the Newlib mailing list