Re: repost: esql compile problems
Posted in 2000
Jonathan Leffler wrote: > > mars1972@my-deja.com wrote: > > > > for timeout.ec in demo code > > > > > > mint cnt = 0; #OK > > > int4 ret = 0; #OK > > > int4 sqlcode = 0; #OK > > > int4 sqlerr_code, sqlstate_err(); #OK > > > void disp_exception(), disp_error(), disp_warning(); > > > > > > EXEC SQL BEGIN DECLARE SECTION; > > > char fld1_val[ CHARFLDSIZE + 1 ]; > > > char fld2_val[ CHARFLDSIZE + 1 ]; > > > int4 int_val; #Fails > > > EXEC SQL END DECLARE SECTION; > > [cutting] > > The types int4 et al are likely to be defined in one of the two > headers which are also automatically included by ESQL/C (the headers > are sqlhdr.h and sqliapi.h in CSDK versions of ESQL/C). These headers > drag in almost all the other ESQL/C headers between them. I can see the definition is the esqlc headers, so it should be Ok > > Now, often it is a problem to obtain control over the compilation > before those headers are #include'd by the C compiler. In this case, > though, the code is copied into the ESQL/C file by the ESQL/C pre- > processor before the C compiler sees it. However, the C pre- > processor will include those files again, and therefore you could > still end up with problems due to repeated typedefs. C99 allows > them when the types are identical, so maybe compilers will let this > through in future. My feeling it's a c4gl/cc command line type problem. As it's Informix's demo code I assumed it would compile :-)) I suspect I need to dig into the final command that are being generated. > > There's a chance I'm worrying unnecessarily -- it may work exactly > as Mars1972 suggests. I have a feeling it will be more complex, though. > > And now I've confused everyone enough, I'll shut up. I'm easily and regularly confused!! -- Paul Watson # WF Software # If it was easy Tel ++44 1436 674729 # Everybody could do it Fax ++44 1436 678693 # www.wfsoftware.com/informix #