From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,5e14b051b7a02efa,start X-Google-Attributes: gidfee84,public From: hsiacc@prometheus.ME.Berkeley.EDU (Andy C. Hsia) Subject: Sun C code compiled on OSF/1?? Date: 1995/07/20 Message-ID: <3umh4p$amh@agate.berkeley.edu>#1/1 X-Deja-AN: 106587467 organization: University of California at Berkeley newsgroups: comp.unix.osf.osf1 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(); -----^ /usr/lib/cmplrs/cc/cfe: Error: t3m..c, line 141: Incompatible function return type for this function long random(); -----------^ /usr/lib/cmplrs/cc/cfe: Error: t3m.c, line 145: redeclaration of 'calloc'; previous declaration at line 145 in file '/usr/include/stdlib.h' extern char *calloc(); -------------^ /usr/lib/cmplrs/cc/cfe: Error: t3m.c, line 145: Incompatible function return type for this function extern char *calloc(); -------------------^ 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 colleague successfully compiled (and run) the code on a Sun using ANSI C (acc on Sun). I successfully compiled (and run) the code on Ultrix 4.2 (using cc -O3 t3m.c -lm). In light of the recent incident regarding reading README files first, etc, let me say that I have read all the documentation that came with the code, I've tried many minor modifications to the code, and I'm not an experienced cc user. If I had to guess, I'd say that simply commenting out the offending lines caused the variables to be defined as the wrong type, therefore doesn't solve my problem. My question is why doesn't the successfully compiled program run properly and what should I look for in fixing it? Thanks andy