Re: esql-c ANSI prototypes
Posted in 1997
In article <5cbc6b$5ka@cssun.mathcs.emory.edu>, johnl@informix.com says...
>No, it doesn't. This is documented on page 1-34 of the Informix-ESQL/C
>Programmer's Manual Version 7.2, and is supported by the following code,
>which fails to compile:
>
>$ cat sample.ec
>int sample($int param)
>{
>}
>$ esql -c sample.ec
>esqlc: "sample.ec", line 4: Error -33017: Incomplete statement.
>$
I beg to slightly differ with your reply. Informix 7.1 and higher (I can't
speak for earlier versions; they didn't show up in Informix 5) does define
prototypes for library functions (risnull, rsetnull, etc. - see
$INFORMIXDIR/incl/esql/sqlhdr.h in Informix 7.14). It is true (as shown by
your example) that it doesn't support the Ansi-style prototype function
definitions.
Joe Lumbley referred to sqlproto.h, which apparently is the Informix 7.2
location for the declarations.
Somewhat ironically, it appears that in 7.14 Informix made an attempt to make
these available for C++ (7.14 has an #ifdef __cplusplus extern "C" { section),
but they embedded the entire thing inside an #ifdef __STDC__, which may or may
not be defined in a C++ compiler. Gnu C++ defines __STDC__; the HPUX C++
compiler doesn't.
--
William Harris william@carsinfo.com
CARS Information Systems
4000 Executive Park Drive
Cincinnati, OH (USA) 45241