This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/1973] getenv returns pointer to unallocated space.
- From: "jakub at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 3 Apr 2006 20:22:04 -0000
- Subject: [Bug libc/1973] getenv returns pointer to unallocated space.
- References: <20051203125947.1973.marvin.nospam@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From jakub at redhat dot com 2006-04-03 20:22 -------
You couldn't be bothered to at least compile your testcase with -Wall?
gcc would warn you about implicit declaration of getenv function.
Implicitly declared functions have int return type, but getenv realllly returns
a pointer, so in your testcase when you mistakenly don't include stdlib.h,
the resulting pointer gets upper 32 bits sign-extended from bit 31 of the
pointer.
Please don't reopen any longer and spend some time reading ISO C99.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |INVALID
http://sourceware.org/bugzilla/show_bug.cgi?id=1973
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.