Tom wrote:
>
> Hello:
>
> Im running esql 5.08UC1. I have the following code:
> #define DAYSIZE 2
> static $char lsun[DAYSIZE];
> static $char lmon[DAYSIZE];
>
> I get the following:
> sqlc: "wbatchctl.ec", line 246: Warning -33208: Runtime error is
> possible because size of 'lsun' is unknown.
> esqlc: "wbatchctl.ec", line 246: Warning -33208: Runtime error is
> possible because size of 'lmon' is unknown.
>
> How can I get rid of this?
>
> Also, If I define as follows:
> static $char lsun[wbatchctl::DAYSIZE];
> static $char lmon[wbatchctl::DAYSIZE];
> where wbatchctl::DAYSIZE is a public enum, I get the same error. Im just
> trying to localize my declarations as enhances maintainability.
>
> thanks,
> tom.
Tom,
I use a header file hack that looks like the following:
/* WARNING: changes must be done in (2) places */
/* visible to 'C' compiler only */
#define MY_SIZE 10
#if 0
/* visible to ESQLC only */
EXEC SQL DEFINE MY_SIZE 10
#endif
Now, in you're .ec source files, you need to do:
EXEC SQL INCLUDE my_header.h;
In 'C' source files, just
#include "my_header.h"
Note that I'm using V7.1. I'm not sure if this will work for V5.
-Peter