home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!ncar!noao!arizona!naucse!naucse.cse.nau.edu
- From: jjt@naucse.cse.nau.edu (Rork)
- Newsgroups: comp.sys.mac.programmer
- Subject: Porting Bison to Mac IIsi using ThinkC5.0
- Keywords: ThinkC, Bison, Gnu, Yacc
- Message-ID: <5337@naucse.cse.nau.edu>
- Date: 27 Jul 92 07:47:20 GMT
- Sender: jjt@naucse.cse.nau.edu
- Organization: Northern Arizona University, Flagstaff AZ
- Lines: 40
-
-
- After dowloading Flex and Bison and making changes in them to get them
- to compile on my Mac IIsi, I decided that I would have to install some
- UNIX system calls that are not available in ThinkC, namely mktemp().
-
- This function returns a temporary file name. I had to write my own
- version of this, which I did, but thumbing through the standard libraries
- I found a function that did a similar thing, tmpnam().
-
- Here's where the problem started, the first call to this function worked
- fine. After that I did a call to malloc(), yes I'm using malloc() but
- it would be too time consuming to change over while porting this unix-based
- software.
-
- Anyways .. the function:
-
- char *mktemp(char *template)
- {
- .
- .
- .
- tmpnam(buf); // buf declared char buf[20];
- .
- .
- str = (char *)malloc(size);
- .
- .
- return something;
- }
-
- this fails in the 2nd call ... going into a lockup during the malloc()
- call on the 2nd call to the function.
-
- I went back to my origibal scheme, w/o the tmpnam() call and it functioned
- correctly again. Anyone have any ideas?
-
- John Theisen
- Macintosh Software Developer
- Precision Computer Systems
- jjt@naucse.cse.nau.edu
-