This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/47375] getlog causes warnings with static linking
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Jan 2011 13:08:47 +0000
- Subject: [Bug libfortran/47375] getlog causes warnings with static linking
- Auto-submitted: auto-generated
- References: <bug-47375-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47375
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-20 13:08:43 UTC ---
Maybe one should use getpwnam_r and getpwuid_r instead of getpwnam and
getpwuid (at least if the _r versions are available); the non-_r versions are
used according to http://gcc.gnu.org/onlinedocs/gfortran/GETLOG.html
>From POSIX/SUS 2003:
"
#include <pwd.h>
struct passwd *getpwuid(uid_t uid);
int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer,
size_t bufsize, struct passwd **result);
[...]
APPLICATION USAGE
[...]
The getpwuid_r() function is thread-safe and returns values in a
user-supplied buffer instead of possibly using a static data area
that may be overwritten by each call."