This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
wstoimax Questions
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Wed, 13 Nov 2013 14:30:38 -0600
- Subject: wstoimax Questions
- Authentication-results: sourceware.org; auth=none
Hi
First, this doesn't have an implementation in newlib
but a prototype is there. But my question is trying
to interpret POSIX to figure out what the right
set of headers a minimal program would have to include.
==================================
#include <inttypes.h>
int main()
{
const wchar_t *restrict* var9 = {0};
wchar_t **restrict* var10 = {0};
int* var11 = {0};
wcstoimax(*var9, *var10, *var11);
return 0;
}
==================================
This works for newlib/rtems but glibc on CentOS
doesn't end up including <wchar.h> and it must
be included in addition. Since this definition
of the method says you need to include <stddef.h>,
that will work.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/wcstoimax.html
But
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html
says inttypes.h shall define imaxdiv_t and wchar_t.
Which implies you only should need to include <inttypes.h>
Is this a glibc bug? Or am I missing something?
This feels like the two pages are almost contradicting
one another on the minimum set of include files.
Thanks.
--
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