This is the mail archive of the
mailing list for the GCC project.
Re: selective linking of floating point support for *printf / *scanf
- From: Andrew Haley <aph at redhat dot com>
- To: Joey Ye <joey dot ye dot cc at gmail dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>, avr-libc-dev at nongnu dot org, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Tue, 02 Sep 2014 09:40:20 +0100
- Subject: Re: selective linking of floating point support for *printf / *scanf
- Authentication-results: sourceware.org; auth=none
- References: <CAMqJFCpWKXVmmc-YLKf9XO6H8C_YnTEcgzkJAidE21MirJbi-w at mail dot gmail dot com> <001401cfc0f9$bdc5cbc0$39516340$ at arm dot com> <CAMqJFCrEOgavwvW25vO=S-+0TZ_xOnDa0Ex-Ff4XG329K5WE9g at mail dot gmail dot com> <001901cfc1c4$d0678630$71369290$ at arm dot com> <CAMqJFCoFC8sVRQB3+v4dzSVc5LLs9cycjm621FmM34gGHRWFng at mail dot gmail dot com> <000001cfc1e3$7f1a22f0$7d4e68d0$ at arm dot com> <CAMqJFCo1EA8TLVsv=r7gW-udiH6pqBKVuQUvHeGcFDqrnMo_EQ at mail dot gmail dot com> <000101cfc281$3a3008f0$ae901ad0$ at arm dot com> <CAMqJFCrrj1_VHmz7G-VgDpLNGjsTtdjPLqbCRY1oVxeO-BESHw at mail dot gmail dot com> <000201cfc34f$1ceadb20$56c09160$ at arm dot com> <54007E28 dot 6090106 at redhat dot com> <CALC6sNDiJ+EOjTasMj2YCQmq10mVQrZKKsaUurhjQe=Zbn435g at mail dot gmail dot com> <000401cfc40a$a22255f0$e66701d0$ at arm dot com> <CAL0py26WdXN0N-jhejLAbEjZ-Q5xT6yunr1gnmcBhvpFPaVEfw at mail dot gmail dot com>
On 09/02/2014 08:33 AM, Joey Ye wrote:
> On Sat, Aug 30, 2014 at 12:26 PM, Thomas Preud'homme
> <email@example.com> wrote:
>>> From: Grissiom [mailto:firstname.lastname@example.org]
>>> 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
>> "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.
newlib is part of the implementation, so it's allowed to do this.