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/1973] getenv returns pointer to unallocated space.


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


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