>From: joana@vcd.hp.com (Joan Armstrong)
>Date: 23 Jan 1997 22:38:28 GMT
>X-Informix-List-Id: <news.32938>
>
>Sorry if this should be well-known (to me), but does esql-c 7.2
>support ANSI prototypes?
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.
$
The ESQL/C compiler must be looking for a semi-colon and is obviously (and
correctly) failing to find one.
What I do to handle prototypes and ESQL/C is:
int sample(int param0)
{
EXEC SQL BEGIN DECLARE SECTION;
int param = param0;
EXEC SQL END DECLARE SECTION;
...
}
In other words, I initialize a local variable with the value of the
parameter, which ESQL/C does not see because it isn't after EXEC SQL
or $.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>