From: hsiacc@prometheus.ME.Berkeley.EDU (Andy C. Hsia)
Subject: Sun C code compiled on OSF/1??
Date: 1995/07/20 [thread overview]
Message-ID: <3umh4p$amh@agate.berkeley.edu> (raw)
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
next reply other threads:[~1995-07-20 4:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-07-20 4:00 Andy C. Hsia [this message]
1995-07-20 4:00 ` Sun C code compiled on OSF/1?? Mike Iglesias
1995-07-21 4:00 ` Eric Osborne
1995-07-21 4:00 ` Mark Charette
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox