Bug 131419
Summary: | wcswcs returns invalid address | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Need Real Name <ssurve> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 3.0 | ||||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | ia64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2004-09-01 08:59:25 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Need Real Name
2004-09-01 07:14:56 UTC
Created attachment 103331 [details]
C program
This is a C program to reproduce the problem
It always help to compile with warnings enabled. gcc -Wall test.c test.c: In function `main': test.c:13: warning: implicit declaration of function `mbstowcs' test.c:17: warning: implicit declaration of function `wcswcs' test.c:17: warning: assignment makes pointer from integer without a cast test.c:31: warning: implicit declaration of function `wcstombs' test.c:32: warning: implicit declaration of function `strlen' test.c:33: warning: int format, different type arg (arg 2) makes it clear that you are missing some includes (particularly #include <string.h> #include <stdlib.h> ) and also, given that wcswcs is a X/Open only function (ISO C99 uses wcsstr), you need to enable X/Open feature set, see info libc on Feature Set Macros. I.e. if you add those two includes and compile with -D_XOPEN_SOURCE, -D_GNU_SOURCE, -D_XOPEN_SOURCE=600 or similar, it will work just fine. Unprototyped functions are assumed to return int, so really bad things happen on 64-bit arches for functions which return pointers or other 64-bit values or on all arches if they return floating point values and prototypes aren't used. |