This is the mail archive of the
mailing list for the newlib project.
Re: C99 support in Newlib
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: "Andre Vieira (lists)" <Andre dot SimoesDiasVieira at arm dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Thu, 14 Jan 2016 09:27:12 -0600
- Subject: Re: C99 support in Newlib
- Authentication-results: sourceware.org; auth=none
- References: <CAOAAYWCVo=_y_z-MMv+kPSnOkdmZyRmdf7-vSBTMxYhD_dpc8Q at mail dot gmail dot com> <20150114161728 dot GJ15791 at calimero dot vinschen dot de> <CAL0py27b0tRYe31X9cSW9FpP8swbY5YLk9UM4XUZk9XTb3vT4w at mail dot gmail dot com> <20150120100612 dot GZ3122 at calimero dot vinschen dot de> <54BE3A2F dot 2030703 at op dot pl> <20150120114638 dot GC3122 at calimero dot vinschen dot de> <54BE40DE dot 9080206 at op dot pl> <5693BBDB dot 9030403 at arm dot com> <5697AAE6 dot 8010602 at arm dot com>
On 1/14/2016 8:04 AM, Andre Vieira (lists) wrote:
On 11/01/16 14:27, Andre Vieira (lists) wrote:
On 20/01/15 11:49, Freddie Chopin wrote:
On 01/20/2015 12:46 PM, Corinna Vinschen wrote:
On Jan 20 12:21, Freddie Chopin wrote:
On 01/20/2015 11:06 AM, Corinna Vinschen wrote:
On Jan 20 17:19, Joey Ye wrote:
Corinna, May I know which features are missing please?
As far as I can tell, mainly the long double functions for targets
with sizeof(double) != sizeof(long double).
I have one more - from my recent browsing of scanf() code, I assume
"%[...]" is supported, but "%[^...]" is not.
No, it is. See libc/stdio/sccl.c.
Right, my mistake (; Sorry for the noise then (;
I thought I'd reply to this thread as it is very much related to my issue.
In a recent GCC patch a change to an optimization, which now checks for
the existence of libc support for C99 functions, lead to a regression
for arm-none-eabi. This is because currently GCC is set up to assume no
C99 support is available for arm-none-eabi. As far as I know this is
because it comes with newlib and as this thread points out it does not
claim to fully support C99. See
Hopefully with some help I can figure out what GCC 'function classes'
can be seen as supported by newlib for arm-none-eabi. These function
functions only part of the standard in C94 or above.
functions only part of the standard in C99 or above.
math complex functions only part of the standard in C99 or above.
functions only part of the standard in C11 or above
And there is also 'function_sincos' for which I couldn't find a
definition though I assume its for the GNU extension 'sincos'.
$arm-none-eabi-nm libm.a | grep sincos
00000000 T sincos
00000000 T sincosf
Can someone confirm the support or lack thereof for these classes in
newlib for 'arm-none-eabi'.
As an investigation exercise I constructed a list of all functions in
the C99 standard and I checked whether the newlib version we build for
arm-none-eabi defined these and I found that it was missing quite a lot
of them! See attached file.
That answers my question for the bugzilla ticket. We can not enable
function_c99_* function class support for arm-none-eabi.
I think you checked it against C11. I spotted thrd_create on the list
and don't think that is C99.
My quick impression is:
+ to agree that the math methods are C99 and missing.
+ thread, mutex and other concurrency objects are C11
+ *_s is C11
+ timespec_get is C11
At least that's based on cppreference.com. Did I miss something?
I agree a complete set of C99 methods is important.
C11 adds some things which newlib should support and others which
are the domain of the hosting environment. Newlib doesn't support
pthreads for example (but has pthread.h) so C11 threads should
follow the same pattern.
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985