[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] selective linking of floating point support for *prin
From: |
Joey Ye |
Subject: |
Re: [avr-libc-dev] selective linking of floating point support for *printf / *scanf |
Date: |
Tue, 2 Sep 2014 15:33:00 +0800 |
On Sat, Aug 30, 2014 at 12:26 PM, Thomas Preud'homme
<address@hidden> wrote:
>> From: Grissiom [mailto:address@hidden
>> Sent: Friday, August 29, 2014 11:51 PM
>>
>> Yes, it does. The namespace reserved for the implementation is _[_A-Z].
> > The namespace _[a-z] is still available for the user. Which means the
>> user can declare their own _printf_float, and WE (as the implementation)
>> MUST NOT INTERFERE with it. Since WE are the implementation, we should
>> use the namespace reserved for us, namely __printf_float.
>
> Mmmh indeed. I checked C99 and section 7.1.3 paragraph 1 third clause states:
>
> "All identifiers that begin with an underscore and either an uppercase letter
> or
> another underscore are always reserved for any use."
>
> Next clause express how single underscore not followed by a capital letter is
> reserved:
>
> "All identifiers that begin with an underscore are always reserved for use as
> identifiers
> with file scope in both the ordinary and tag name spaces."
Apparently newlib is not following this specification very well, as
there are symbols like _abc_r defined every where in current newlib. I
am not implying the spec should not be followed, but is newlib
designed to have a loose spec for the single underscore?
- Joey
>
> Since here we are talking about linkage, _printf_float is not safe according
> to the
> standard.
>
> Sigh.
>
> Ok I need to think about it. Thank you all for pointing out the problem with
> the
> current scheme.
>
> Best regards,
>
> Thomas
>
>
- Re: [avr-libc-dev] selective linking of floating point support for *printf / *scanf,
Joey Ye <=