incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lemings" <Eric.Lemi...@roguewave.com>
Subject RE: %{Ao}, %{Ad}, and %{Ax} directives
Date Wed, 14 May 2008 14:28:40 GMT
 

> -----Original Message-----
> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
> Sent: Tuesday, May 13, 2008 11:29 PM
> To: dev@stdcxx.apache.org
> Subject: Re: %{Ao}, %{Ad}, and %{Ax} directives
> 
> Eric Lemings wrote:
> >  
> > All of the test cases for the %{Ao}, %{Ad}, and %{Ax} directives (in
> > 0.printf.cpp) specify a width (width of integer elements to 
> be exact).
> > Does this mean the width is required?  I can't easily 
> discern this by
> > reading the code.
> 
> I don't know off the top of my head but from the output of
> the program below (on x86 hardware) I'm guessing the default
> width is 1 and the precision is taken to be the number of
> initial non-zero elements of the array (each of the given
> width). It might be worthwhile to enhance the test to
> exercise this.

Exactly what I was thinking.

Brad.

> 
> $ cat t.cpp && ./t
> #include <rw_printf.h>
> 
> int main ()
> {
>      const int a [] = { 0x12345678, 0 };
>      rw_printf ("%{Ax}\n", a);
> }
> 78,56,34,12
> 
> Martin
> 

Mime
View raw message