From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,982cbb3670b4b8c4 X-Google-Attributes: gidfee84,public From: Marc Roussel Subject: Re: Problem with C compiler? Date: 1996/08/30 Message-ID: <3226FF31.41C6@henri.chem.uleth.ca>#1/1 X-Deja-AN: 177449060 references: <28AUG96.13550198.0011@AACCI.AACC.CC.MD.US> content-type: text/plain; charset=us-ascii organization: Department of Chemistry, University of Lethbridge mime-version: 1.0 newsgroups: comp.unix.osf.osf1 x-mailer: Mozilla 2.02 (X11; I; OSF1 V3.2 alpha) Scott Kramer wrote: > I keep getting a segmentation fault when using the time() > function. I have looked at the cc documentation over and over and > can see no reason why this will not work. > > long *tloc; > time(tloc); Your code is nonportable. Read the time(3) man page. tloc should be pointer-to-time_t and time_t is defined in time.h. As it happens, time_t is not a long but an int on the alpha. Marc R. Roussel (roussel@henri.chem.uleth.ca) Department of Chemistry University of Lethbridge