Re: informix 4GL and ESQL/C
Posted in 1998
Max Ming wrote: > > Hi, > > Does anyone know how to make c4gl and esql C preprocess to be ANSI C > compliance. I used "-ansi" flag in c4gl and esql but I got a lot of > error messages from cc compiler. We're using dynamic online informix > 7.xx version. Where I can find c4gl/c document ? > > Thanks. > Max > maxming@earthlink,net The -ansi flag controls flagging of non-ANSI SQL, not C. RTFM. I haven't examined the C output from the 4GL compiler recently, but I think it is not ANSI C compatible. The output of ESQL/C I am less sure about. The parts you write will be unchanged. For 4GL, why is the nature of the C important to you? I cannot think of any sensible reason to change it, so if it compiles OK, why bother? For ESQL/C I can see that you might want to enforce ANSI C and that the only way to do this would be by the C compiler, which would complain if the ESQL/C preprocessor emitted non-ANSI C. However, I don't think you are going to be able to change it. I would guess that Informix wrote their preprocessor for the lowest common denominator C, and that could be pretty low. As a work-around, you could make the ESQL/C files fairly pure SQL and put the rest of the C code in separate files, for which you enforce ANSI standards. This might introduce a small function-calling overhead. There's no free lunch. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 --- If all else fails, read the instructions and the release notes. Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/ ---