C99 anomolies... ?

Joel Sherrill joel.sherrill@oarcorp.com
Tue Aug 26 22:43:00 GMT 2014


On 8/26/2014 5:30 PM, DJ Delorie wrote:
> As part of our internal testing I found a few bits of newlib that
> don't seem to be "right" with C99, enough to cause problems with the
> testing framework.  Comments?
>
> llabs / lldiv
>
> 	Official as of C99, but in stdlib.h they're still #ifndef
> 	__STRICT_ANSI__.  There are #tests for C90 and C++11
> 	declarations elsewhere, is anyone working on #tests for C99?
> 	Or is newlib still officially just C90?
In general terms, the RTEMS community has been trying to fix some of the
OS level guards but on no specific timetable. We had Google Code In students
help add the restrict keyword which is C99. Personally, I think adding the
C99 and C++11 guards is important.

My rule has been that if I fix a file for something, it has to be fixed
for all
of that pattern.

Unfortunately, I don't think there is a master tracking sheet of what files
have had what reviews/updates done yet.
> <math.h>
>
> 	has:
> 	 extern long double frexpl _PARAMS((long double value, int *));
> 	but the "value" part is problematic.  Should be:
> 	 extern long double frexpl _PARAMS((long double, int *));
> 	Looks like the only case of this in <math.h>
Fix it. :)
> nexttoward
> nexttowardf
> nexttowardl
>
> 	any plans to add these?
Not from the RTEMS side.

This is an unfortunately long list of some of the things I found missing
a couple of years ago when I compared RTEMS+newlib to the Open
Group FACE General Purpose POSIX Profile. These may be POSIX or
C99, I didn't investigate that:

cabsl cacoshl cacosl cargl casinhl casinl catanhl catanl ccoshl ccosl
  cexpl cimagl clogl conjl cpowl cprojl creall csinhl csinl csqrtl
  ctanhl ctanl log2l logbl
nexttoward nexttowardf nexttowardl
feclearexcept fegetenv fegetexceptflag fegetround feholdexcept
   feraiseexcept fesetenv fesetexceptflag fesetround fetestexcept
   feupdateenv
imaxabs imaxdiv
strtoimax strtoumax
wcstoimax wcstoumax

No idea what to do about those.

-- 
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



More information about the Newlib mailing list