*BSD News Article 7366


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!hp9000.csc.cuhk.hk!saimiri.primate.wisc.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!princeton!shade.Princeton.EDU!jsm
From: jsm@shade.Princeton.EDU (John Scott McCauley Jr.)
Subject: Re: mktemp - Bus Error.
Message-ID: <1992Nov3.174359.19262@Princeton.EDU>
Originator: news@nimaster
Sender: news@Princeton.EDU (USENET News System)
Nntp-Posting-Host: shade.princeton.edu
Organization: Princeton University
References: <1992Nov2.210351.12723@ee.ryerson.ca> <1992Nov2.215333.1434@Princeton.EDU> <KHERA.92Nov3111245@thneed.cs.duke.edu>
Date: Tue, 3 Nov 1992 17:43:59 GMT
Lines: 20

In article <KHERA.92Nov3111245@thneed.cs.duke.edu> khera@cs.duke.edu (Vivek Khera) writes:
[on mktemp]
>you don't need something so complicated.  how about this:
>
>	char tmpname[] = "/tmp/foo.XXXXXX";
>	mktemp(tempname);
[should be tmpname]
>

Careful -- it doesn't work for some C-compilers:
"t.c", line 3: no automatic aggregate initialization
"t.c", line 3: illegal lhs of assignment operator


Program defensively! I'd rather have something complicated that works!

	Scott

P.S. When was initialization of aggregates added? Don't think it was in
K&R first edition or pcc.