Re: Errors compiling dbcopy.ec
Posted in 1998
Mark.Wise@ps.net wrote: > > I downloaded a dbcopy utility from the IIUG repository . My problem is > when I try compiling it with esql I get the following error messages. > I am on HPUX10.2 , 7.23 UC1X8. [SNIPPED REPEATED MESSAGE] > cc: "dbcopy.ec", line 86: error 1705: Function prototypes are an ANSI > feature. > cc: "dbcopy.ec", line 326: error 1000: Unexpected symbol: ")". > cc: error 2017: Cannot recover from earlier errors, terminating. > > Any suggestions? I'm the author of that utility. The source uses ANSI "C" function prototypes and apparently the default "C" compiler that ESQL/C is using on your platform is not ANSI compliant. If you have another ANSI compliant compiler available, set the INFORMIXC environment variable to the name of that compiler's driver program (ie INFORMIXC=gcc for GNU C) and export INFORMIXC. The esql script calls $CC which is set as follows: CC=${INFORMIXC=cc} on most platforms. The default compiler driver is not ANSI C. If you do not have ANSI C you will have to edit the source and modify the function prototypes and declarations to K&R style. ANSI C is so prevalent these days that I have stopped writting code portable to K&R compilers myself. Sorry about that. The error reported about line 326 is a typecast of a NULL pointer using a typedef'd type to cast the NULL to a pointer to struct datetime, or typedef dtime_t, which is not an ANSI feature so I do not know why the compiler is complaining. It looks like a bug in the compiler's parser. You might try putting parenthesis around the entire rvalue: dtime_t *dt = ((dtime_t *)NULL); or initialize the pointer after the declaration block: dtime_t *dt; char string[1025]; dt = (dtime_t *)NULL; Art S. Kagel