public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bill Ahlbrandt <bahlbr@icdata.com>
To: "'egcs@cygnus.com'" <egcs@cygnus.com>
Subject: tmpnam() core dumping
Date: Fri, 12 Dec 1997 06:18:00 -0000	[thread overview]
Message-ID: <01BD06D5.E1EF50C0@bill.icdata.com> (raw)

I am getting a core dump when I use the tmpnam() function.

I'm running slackware 2.0.29, 

gcc -v gives:

Reading specs from /usr/local/lib/gcc-lib/i486-pc-linux-gnulibc1/egcs-2.90.21/specs
gcc version egcs-2.90.21 971202 (egcs-1.00 release)

This probably has nothing to do with egcs, but being extremely new this environment and compiler, any assistance will be much appreciated.

Note that the tempnam function works just fine.


The following code produces the output that follows:

#include <stdio.h>

int main() {
  char *tempFileName;
  printf("doing tempnam\n");
  tempFileName=tempnam(".","xxx");
  printf("done\n");
  if (tempFileName) {
    printf("I got %s\n",tempFileName);
  } else {
    printf("Got an error\n");
  } /* endif */

  printf("doing tmpnam\n");
  tempFileName=tmpnam("xxx");
  printf("done\n");
  if (tempFileName) {
    printf("I got %s\n",tempFileName);
  } else {
    printf("Got an error\n");
  } /* endif */
  return 0;
}


mail:~/src/bug$ gcc bug.cpp
mail:~/src/bug$ a.out
doing tempnam
done
I got ./xxx30905aaa
doing tmpnam
Segmentation fault (core dumped)
mail:~/src/bug$                                                                                                                                       


Thanks in advance.

Bill Ahlbrandt



             reply	other threads:[~1997-12-12  6:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-12  6:18 Bill Ahlbrandt [this message]
1997-12-12  8:02 ` Jeffrey A Law
1997-12-12 14:32 ` Marc Lehmann
1997-12-12 10:18 Bill Ahlbrandt
1997-12-12 13:04 ` Per Bothner
1997-12-12 15:46 ` Tim Hollebeek
1997-12-15  2:51 ` Andreas Schwab
1997-12-13  9:55 Bill Ahlbrandt
1997-12-15  8:20 Bill Ahlbrandt

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=01BD06D5.E1EF50C0@bill.icdata.com \
    --to=bahlbr@icdata.com \
    --cc=egcs@cygnus.com \
    /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: link
Be 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).