From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,5e14b051b7a02efa X-Google-Attributes: gidfee84,public From: charette@ultoe.det.dec.com (Mark Charette) Subject: Re: Sun C code compiled on OSF/1?? Date: 1995/07/21 Message-ID: <3umt3a$r2i@eccdb1.pms.ford.com>#1/1 X-Deja-AN: 106587474 references: <3umh4p$amh@agate.berkeley.edu> organization: ECC at Ford Motor Company, Dearborn Michigan newsgroups: comp.unix.osf.osf1 Andy C. Hsia (hsiacc@prometheus.ME.Berkeley.EDU) wrote: : I'm trying to compile C code written for Sun computer on our Alpha 3000/600 : running OSF/1 2.0. At first, I got a few errors like the following: : /usr/lib/cmplrs/cc/cfe: Error: t3m..c, line 141: redeclaration of : 'random'; previous declaration at line 245 in file '/usr/include/stdlib.h' : long random(); : -----^ ... : So I commented out the offending lines. The code compiled with no : warnings or errors, but doesn't run properly. When run, the program : should say, "Starting analysis" and "The volume fraction is..." My : program, however, just says "Starting analysis," and doesn't go on. A 'ps : ux' shows that the program is utilizing 99% of the CPU, but no output. A Chances are that commenting out the offending lines (such as long random();) haven't caused any errors, since the correct prototype is in the system include files (the reason you were getting the errors). However, fixing the problem of longs and pointers being 8 bytes (64 bits) in length now rears its head. Try cc -migrate and check and correct any warnings Use lint -Q and correct any pointer/integer mismatches grep for long & make sure that the variables REALLY should be long, not an int. Make sure every long & pointer passed as arguments are accepted as long & pointer. Put protoypes in for all your codes. There's more but this should get you pointed in the right direction. -- Mark Charette charette@mika.com MIKA Systems, Inc 17197 N. Laurel Park Dr Suite 115 Livonia, MI 48152