This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: missing methods in inttypes.h


On 7/30/2013 4:13 AM, Corinna Vinschen wrote:
On Jul 29 09:14, Joel Sherrill wrote:
Hi

I am curious where the missing methods from inttypes.h
should go (eventually) in the source tree?

intmax_t  imaxabs(intmax_t);
imaxdiv_t imaxdiv(intmax_t, intmax_t);
intmax_t  strtoimax(const char *restrict, char **restrict, int);
uintmax_t strtoumax(const char *restrict, char **restrict, int);
intmax_t  wcstoimax(const wchar_t *restrict, wchar_t **restrict, int);
uintmax_t wcstoumax(const wchar_t *restrict, wchar_t **restrict, int);
For Cygwin, they are just aliases of the respective method using the
biggest available datatype:

   imaxabs = llabs
   imaxdiv = lldiv
   strtoimax = strtoll
   strtoumax = strtoull
   wcstoimax = wcstoll
   wcstoumax = wcstoull

In theory, every target can handle it that way without the need
to implement these functions explicitely.
When you say aliases, do you mean just wrapper methods?

Can the Cygwin versions be merged into newlib so every newlib target
has these?

FWIW when I looked at FreeBSD, the few I looked at had their own
real implementations which were not wrappers. I can see that wrapping
the largest type is OK though.

Corinna



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]