Steve M. Fabac, Jr. wrote:

> I am investigating moving a client from 3.2v4.2 to SCO 5.0.6 but am having
> problems with gcc on 5.0.6 when trying to compile on of the client's application.
>
> First, I'm no programmer. If I can type "cc program.c" and get an a.out that will
> run I'm happy. There are no notes or make files on the client's 3.2v4.2 system.
> when I type: gcc -I /usr/informix/incl swlsvr.c
>
> I get:
>
> sqlsvr.ec: In function `main':
> sqlsvr.ec:133: `errno' undeclared (first use in this function)
> sqlsvr.ec:133: (Each undeclared identifier is reported only once
> sqlsvr.ec:133: for each function it appears in.)


`errno' is declared in . It should be #included by something
before line 133 of "sqlsvr.ec". I'm assuming that "sqlsvr.ec" as
#included by "swlsvr.c" which you were compiling.

It seems odd that this would have compiled at all (on the old system) if
it didn't properly include . Maybe you should start by making
sure you can compile the stuff on the _old_ system with the _old_
compiler.

The fact that there's no makefile is also suspicious. If there isn't a
file named "makefile" or "Makefile", there really ought to be
_something_ that does the compilation -- a shell script or who knows
what. If that's missing, it's like receiving a kit-car with no assembly
instructions.

> sqlsvr.ec:210: warning: assignment makes pointer from integer without a cast
> sqlsvr.ec:235: warning: assignment makes pointer from integer without a cast
> sqlsvr.ec:235: warning: assignment makes pointer from integer without a cast
> sqlsvr.ec:236: warning: assignment makes pointer from integer without a cast
> sqlsvr.ec:239: syntax error before `_FS0'
> sqlsvr.ec:239: warning: assignment makes pointer from integer without a cast
> sqlsvr.ec:239: `_FS0' undeclared (first use in this function)
> sqlsvr.ec:276: warning: assignment makes pointer from integer without a cast
> sqlsvr.ec:277: warning: assignment makes pointer from integer without a cast
> sqlsvr.ec:278: warning: assignment makes pointer from integer without a cast
> sqlsvr.ec:283: parse error before `else'
> sqlsvr.ec: At top level:
> sqlsvr.ec:287: parse error before `void'
> sqlsvr.ec:318: warning: parameter names (without types) in function declaration
> sqlsvr.ec:318: warning: data definition has no type or storage class
> sqlsvr.ec:319: parse error before `('
> sqlsvr.ec:321: warning: parameter names (without types) in function declaration
> sqlsvr.ec:321: conflicting types for `free'
> /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/include/stdlib.h:118: previous
> declaration of `free'
> sqlsvr.ec:321: warning: data definition has no type or storage class
> sqlsvr.ec:322: parse error before `return'
>
> I have searched google and groups.google for gcc compiler switches to
> support old style c but have come up empty.


I doubt this is a "style" issue. The code is incomplete or not being
compiled correctly.

Look at the files (follow the #include chain from "swlsvr.c"). Maybe it
would #include if some manifest was defined, e.g. it might
need:

cc -DHAVE_ERRNO_H swlsvr.c

You need to examine the source enough to follow the chain. This would
be trivial for a moderately experienced C programmer, but you say "I'm
no programmer". This might be a little too much trial by fire -- if you
get totally stuck, bring in someone with the appropriate sort of
experience.

>Bela<