Re: ESQL/C and ANSI-C Compiler
Posted in 1993
In article <1993Apr29.151510.3877@colorado.edu> huangp@nemo.Colorado.EDU (Pei-yu Huang) writes: >Netters: > > Has anyone been stuck, just as I am now, with an ANSI-compiler >and esqlc? Stuck? I went out of my way to install gcc so I gain the advantages of an ANSI compiler! Function prototypes and the consequent function parameter type checking has saved me *a lot* of time, not to mention the oodles of time I've saved because I get to use gdb now. >I'm running SGI C++ compiler release 3.10 with ESQL/C 4.0. >Said compiler demands declaration for _iqdbase, _iqbeginwork, >_iqcommit, to name a few generated by esqlc from *.ec file. Really? Doesn't the compiler have some sort of "-non_pedantic" flag? >Can one get >this info. from Informix Software, Inc.? I wouldn't be surprised if they >say it's proprietory, and rightly so. Plan B would be trying to figure >out the prototypes oneself. Is this knowledge available? Sure! Just look in your .c file. I have ESQL/C 2.something, and a grep of a big application didn't turn up _iqdbase so I can't tell you directly, but I bet that they have a return type of void. If you want to take the easy way out, just try: extern void _iqdbase(...); extern void _iqbeginwork(...); extern void _iqcommit(...); If that doesn't work, try substituting "int" for "void" for the ones that give you compile errors. My guess is that most ESQL library functions take a variable number of parameters, so you'd probably want to stick with the (...) anyway, even if you knew what the types could be. SHAMELESS PLUG FOLLOWS: I *highly* recommend gcc and gdb for esql/c development. It takes a bit of monkeying around to get gdb to display the right source line (if anyone's interested, I'll post an article saying how I kludge my way around this), but boy is it a time saver. Plus, gcc produces smaller (and I assume better) code for everything I tested it on (but then my other compiler is the one that comes with SCO, which probably isn't great). The only problem that I've run into is that esql/c is too stupid to understand the following kind of function declaration: void frob(void (*fp)(char *)) <..> (that is, function returning void taking one argument, a pointer to a function that returns void and takes one argument of type char *). esql chokes on this, but I can get esql to be happy with a simple typedef: typedef void (*void_fun_taking_char_ptr)(char *); void frob(void_fun_taking_char_ptr fp) <...> Sigh. I wonder if the newer esql/c's are any more intelligent about this? (And I wonder if they're any better with putting #line directives in all the right places?) -- Bill Foote bill@pds.com PDS Corp, Los Angeles, CA USA uunet!promdist!bill