Re: ESQL/C problems
Posted in 1994
>From: mltsa!ltaylor@mlgtw.att.com >Date: Mon, 17 Jan 94 15:29:33 GMT >To: informix-list@rmy.emory.edu >Subject: ESQL/C problems >I am using esql/c v 5.01 on HP-UX 9.01 and wish to compile using HP's C++ >compiler "CC" (version A.03.20) which can compile standard ANSI C files. >However I cannot compile the esql output .c file because of many >unresolved typechecks i.e. undefined functions & inaccurate function >prototypes (not ANSI compatible!) - the compiler is very unforgiving and >will not allow you to let these go! In which case, the compiler does not accept ANSI C, because ANSI C does *NOT* require prototypes for functions as it accepts K&R C without complaint. C++, of course, requires ALL functions without exception to be prototyped, but ANSI C does not. However, you are correct in saying that: (a) Informix does not provide ANSI C function prototypes (b) Some of the code emitted by ESQL/C plays fast and loose with using (char *)0 as a dummy argument where (struct something *)0 is required. >Is there any way around this - and is it really a non-compliance >on the Informix software ? The closest I can get you is the set of ESQL/C headers with prototypes which have been distributed to informix-list in the past (and are therefore available from the FTP archive at rmy.emory.edu). These provide the correct function prototypes, but cannot do anything about fixing the erroneous casts which are apt to throw the compiler into fits. The best I can suggest is to post-process the .c file and deal with the casts using a sed script. The good news is that the calls are stereotyped and it can therefore be done without much difficulty using any of sed, awk or perl (take your pick). It depends on your point of view as to whether this is non-compliance by Informix. Point (a) is not required by ANSI C. Point (b) is highly suspect. To the best of my knowlege, we have never claimed that ESQL/C code is acceptable to C++ compilers. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>