This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

[Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string


------- Additional Comments From bugs at daylessday dot org  2007-12-14 10:53 -------
>nl_langinfo doesn't return always char pointers.

Well, this definitely not expected..
The documentation doesn't mention anywhere that this function may return 
anything except for strings.
---
RETURN VALUE
       If no locale has been selected for the appropriate category,
       nl_langinfo() returns a pointer to the corresponding string in the 
       "C" locale.
---

>From what I see, this behaviour exists only in glibc (both MacOS and AIX know 
nothing about _NL_TIME_WEEK_1STDAY and return day name when 17 is passed) and 
probably violates the X/Open standard, according to which the function should 
return char *, not union.

/usr/include/langinfo.h doesn't have any indication of possible return values.
Can I see the extended list of 'item' values somewhere (with the corresponding 
return values)?
Are there any more undocumented return values?

Thanks in advance.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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