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/5532] New: Not clear behaviour of function strerror_r


Program:

#define _REENTRANT
#include <string.h>
#include <stdio.h>

int main()
{
 char s[1024];
 strerror_r(1, s, 1024);
 printf("\ns = \"%s\" len = %d\n\n", s, strlen(s));
 return 0;
}

Save this program as a.c and a.cpp

> gcc a.c
> ./a.out

s = "Operation not permitted" len = 23

> g++ a.cpp
> ./a.out

s = "���ӷPÓ·hÕ?�Y���" len = 21

> icpc a.cpp
> ./a.out

s = "@���D���" len = 8

-- 
           Summary: Not clear behaviour of function strerror_r
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: ylalym at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com


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

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