public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mrs at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/51803] New: gfortran getcwd at startup Date: Mon, 09 Jan 2012 20:57:00 -0000 [thread overview] Message-ID: <bug-51803-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51803 Bug #: 51803 Summary: gfortran getcwd at startup Classification: Unclassified Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: mrs@gcc.gnu.org This code: memset (buf, 0, sizeof (buf)); #ifdef HAVE_GETCWD cwd = getcwd (buf, sizeof (buf)); #else cwd = ""; #endif /* exe_path will be cwd + "/" + argv[0] + "\0" */ path = malloc (strlen (cwd) + 1 + strlen (argv0) + 1); sprintf (path, "%s%c%s", cwd, DIR_SEPARATOR, argv0); exe_path = path; please_free_exe_path_when_done = 1; from libgfortran/runtime/main.c:store_exe_path is bad. getcwd can fail with a 0 return status. I didn't have getdents wired up completely in my simulator, and fortran fails everything in the testsuite because of it. :-( Should be something like: #ifdef HAVE_GETCWD cwd = getcwd (buf, sizeof (buf)); if (cwd == 0) cwd = ""; #else
next reply other threads:[~2012-01-09 20:57 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-01-09 20:57 mrs at gcc dot gnu.org [this message] 2012-01-10 7:21 ` [Bug libfortran/51803] " jb at gcc dot gnu.org 2012-01-10 10:04 ` rguenth at gcc dot gnu.org 2012-01-10 16:40 ` mrs at gcc dot gnu.org 2012-01-10 16:45 ` mrs at gcc dot gnu.org 2012-01-11 7:35 ` jb at gcc dot gnu.org 2012-01-11 7:48 ` jb at gcc dot gnu.org 2012-01-12 9:59 ` jb at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-51803-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).