[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] Printf with leading zeros?
From: |
Rick Mann |
Subject: |
Re: [avr-chat] Printf with leading zeros? |
Date: |
Tue, 1 Feb 2011 16:26:32 -0800 |
Looking at the vfprintf() code, I see there's support for three levels of
complexity. Is there any pre-built library for the middle level (PRINTF_STD)?
On Feb 1, 2011, at 15:27:25, Rick Mann wrote:
> Done.
>
> https://savannah.nongnu.org/bugs/index.php?32322
>
> On Feb 1, 2011, at 15:15:09, Weddington, Eric wrote:
>
>>
>> Please open a bug report on the avr-libc project on Savannah, with a
>> reproducible test case.
>>
>> Thanks,
>> Eric
>>
>>> -----Original Message-----
>>> From: address@hidden [mailto:avr-
>>> address@hidden On Behalf Of Rick Mann
>>> Sent: Tuesday, February 01, 2011 3:43 PM
>>> To: Andy Warner
>>> Cc: address@hidden
>>> Subject: Re: [avr-chat] Printf with leading zeros?
>>>
>>>
>>> Thanks for that, but I'm still seeing issues. Note that in my last email,
>>> I mentioned that the behavior I'm seeing is *with* the floating-point
>>> version of the library.
>>>
>>> Moreover, the docs you quoted say "but only the # additional option can be
>>> specified," although I don't know what that means, exactly. It seems to
>>> say that "#" can be used, but other flags cannot (including width
>>> specifiers). However, later on the page, under "Notes," it says "For
>>> default version the width field and the "pad to left" ( symbol minus )
>>> option will work in this case," suggesting that the field width and pad-
>>> to-left flags work (in the case of floating point conversions, which
>>> render as question marks). This suggests that even in the default version
>>> of the library, field width specification should work.
>>>
>>> None of that explains why some *values* result in different behavior.
>>>
>>> Note that I don't mind losing the "#" flag, but that specifying zero-
>>> padding and field minimum width is required, and I don't get that with
>>> even the floating point version of the library.
>>>
>>> --
>>> Rick
>>>
>>>
>>> On Feb 1, 2011, at 10:53:04, Andy Warner wrote:
>>>
>>>> On Tue, Feb 1, 2011 at 12:32 PM, Rick Mann <address@hidden>
>>> wrote:
>>>>> [...]
>>>>> There is clearly something broken in the library.
>>>>
>>>> Are you falling foul of the default stripped-down vfprintf()
>>> implementation.
>>>> From the vfprintf docs @
>>>> http://www.nongnu.org/avr-libc/user-
>>> manual/group__avr__stdio.html#gaa3b98c0d17b35642c0f3e4649092b9f1
>>>> (scroll down a bit..)
>>>>
>>>> ...
>>>> Since the full implementation of all the mentioned features becomes
>>>> fairly large, three different flavours of vfprintf() can be selected
>>>> using linker options. The default vfprintf() implements all the
>>>> mentioned functionality except floating point conversions. A minimized
>>>> version of vfprintf() is available that only implements the very basic
>>>> integer and string conversion facilities, but only the # additional
>>>> option can be specified using conversion flags (these flags are parsed
>>>> correctly from the format specification, but then simply ignored).
>>>> This version can be requested using the following compiler options:
>>>>
>>>> -Wl,-u,vfprintf -lprintf_min
>>>>
>>>> If the full functionality including the floating point conversions is
>>>> required, the following options should be used:
>>>>
>>>> -Wl,-u,vfprintf -lprintf_flt -lm
>>>>
>>>> ...
>>>>
>>>> --
>>>> Andy
>>>>
>>>> _______________________________________________
>>>> AVR-chat mailing list
>>>> address@hidden
>>>> http://lists.nongnu.org/mailman/listinfo/avr-chat
>>>
>>>
>>> _______________________________________________
>>> AVR-chat mailing list
>>> address@hidden
>>> http://lists.nongnu.org/mailman/listinfo/avr-chat
>
>
> _______________________________________________
> AVR-chat mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-chat
- [avr-chat] Printf with leading zeros?, Rick Mann, 2011/02/01
- Re: [avr-chat] Printf with leading zeros?, Michael N. Moran, 2011/02/01
- Re: [avr-chat] Printf with leading zeros?, Rick Mann, 2011/02/01
- Re: [avr-chat] Printf with leading zeros?, Andy Warner, 2011/02/01
- Re: [avr-chat] Printf with leading zeros?, Rick Mann, 2011/02/01
- RE: [avr-chat] Printf with leading zeros?, Weddington, Eric, 2011/02/01
- Re: [avr-chat] Printf with leading zeros?, Rick Mann, 2011/02/01
- Re: [avr-chat] Printf with leading zeros?,
Rick Mann <=
- Re: [avr-chat] Printf with leading zeros?, Joerg Wunsch, 2011/02/04