Compiler always throws Warning -33208 in IDS
Posted in 2008
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi, We are using IDS 11.0 under REHL 5.0 When we comipled the ec files that were developed under Informix 5.0, we are getting the below error "Warning -33208: Runtime error is possible because size of 'create_fin_time1' is unknown" When we searched in internet, we found the below information "esqlc:warning -33208 Runtime error is possible because size of host-variable-name is unknown. This message is a warning only; compilation continues. ESQL/C does not know the size of the host character variable. If the variable is used in an INTO clause, memory might be overwritten. Specify the variable as a character array with a numeric size. The numeric size can be a literal value or an ESQL/C macro value" Also we found the below release notes, * This functionality is addressed in Version 6.0. B28011: GLOBAL ARRAYS WITH DEFINES OR ADDITIONS WILL GIVE WARNING 33208 ON COMPILE. LOCAL ARRAYS WORK FINE. This problem may occur if you have a global array in an ESQL/C program defined as: 1. myvar[1 + 1] 2. myvar[MYDEF + 1] where (either #define or ) 3. myvar[MYDEF] where (#define MYDEF & not MYDEF) Is there any way we would like to retain the size variable in a header file and still dont want the esqlc compiler to throw an error. Any help appreciated.
You have a pointer to an array being used as a host variable for a char column rather than an array of char. Since the compiler doesn't know how wide the array is it is warning you that it has to assume that the memory that the pointer addresses will be wide enough to hold the incoming character data which may cause memory corruption if indeed you did not allocate a large enough block of memory. The older ESQL compilers did not detect or warn about this clear coding error, the new SDK does. That's all. If your code is good ignore it, if it is not fix it. If it should be passing an array rather than a pointer, fix that. Art On Fri, Nov 7, 2008 at 9:51 AM, LAKSHMI DEVI PALANISSAMY < lakshmidevip@hcl.in> wrote: > Hi, > > We are using IDS 11.0 under REHL 5.0 > > When we comipled the ec files that were developed under Informix 5.0, we > are > getting the below error > "Warning -33208: Runtime error is possible because size of > 'create_fin_time1' > is unknown" > > When we searched in internet, we found the below information > "esqlc:warning -33208 Runtime error is possible because size of > host-variable-name is unknown. > This message is a warning only; compilation continues. ESQL/C does not know > the size of the host character variable. If the variable is used in an INTO > clause, memory might be overwritten. Specify the variable as a character > array > with a numeric size. The numeric size can be a literal value or an ESQL/C > macro value" > > Also we found the below release notes, > * This functionality is addressed in Version 6.0. > > B28011: GLOBAL ARRAYS WITH DEFINES OR ADDITIONS WILL GIVE WARNING > > 33208 ON COMPILE. LOCAL ARRAYS WORK FINE. > > This problem may occur if you have a global array in an ESQL/C > > program defined as: > > 1. myvar[1 + 1] > > 2. myvar[MYDEF + 1] where (either #define or ) > > 3. myvar[MYDEF] where (#define MYDEF & not MYDEF) > > Is there any way we would like to retain the size variable in a header file > and still dont want the esqlc compiler to throw an error. > > Any help appreciated. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.
Oops missed the bottom or your post. The actual problem is that you #defined the size of the array. Either change that to EXEC SQL DEFINE ....; or add the compile time option to run the "C" preprocessor BEFORE the ESQL/C compiler rather than after. Art On Fri, Nov 7, 2008 at 12:32 PM, Art Kagel <art.kagel@gmail.com> wrote: > You have a pointer to an array being used as a host variable for a char > column rather than an array of char. Since the compiler doesn't know how > wide the array is it is warning you that it has to assume that the memory > that the pointer addresses will be wide enough to hold the incoming > character data which may cause memory corruption if indeed you did not > allocate a large enough block of memory. The older ESQL compilers did not > detect or warn about this clear coding error, the new SDK does. That's > all. If your code is good ignore it, if it is not fix it. If it should be > passing an array rather than a pointer, fix that. > > Art > > > On Fri, Nov 7, 2008 at 9:51 AM, LAKSHMI DEVI PALANISSAMY < > lakshmidevip@hcl.in> wrote: > >> Hi, >> >> We are using IDS 11.0 under REHL 5.0 >> >> When we comipled the ec files that were developed under Informix 5.0, we >> are >> getting the below error >> "Warning -33208: Runtime error is possible because size of >> 'create_fin_time1' >> is unknown" >> >> When we searched in internet, we found the below information >> "esqlc:warning -33208 Runtime error is possible because size of >> host-variable-name is unknown. >> This message is a warning only; compilation continues. ESQL/C does not >> know >> the size of the host character variable. If the variable is used in an >> INTO >> clause, memory might be overwritten. Specify the variable as a character >> array >> with a numeric size. The numeric size can be a literal value or an ESQL/C >> macro value" >> >> Also we found the below release notes, >> * This functionality is addressed in Version 6.0. >> >> B28011: GLOBAL ARRAYS WITH DEFINES OR ADDITIONS WILL GIVE WARNING >> >> 33208 ON COMPILE. LOCAL ARRAYS WORK FINE. >> >> This problem may occur if you have a global array in an ESQL/C >> >> program defined as: >> >> 1. myvar[1 + 1] >> >> 2. myvar[MYDEF + 1] where (either #define or ) >> >> 3. myvar[MYDEF] where (#define MYDEF & not MYDEF) >> >> Is there any way we would like to retain the size variable in a header >> file >> and still dont want the esqlc compiler to throw an error. >> >> Any help appreciated. >> >> >> >> ******************************************************************************* >> Forum Note: Use "Reply" to post a response in the discussion forum. >> >> > > > -- > Art S. Kagel > Oninit (www.oninit.com) > IIUG Board of Directors (art@iiug.org) > > Disclaimer: Please keep in mind that my own opinions are my own opinions > and do not reflect on my employer, Oninit, the IIUG, nor any other > organization with which I am associated either explicitly or implicitly. > Neither do those opinions reflect those of other individuals affiliated > with any entity with which I am affiliated nor those of the entities > themselves. > > -- Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.
I have serious objections to that warning, but the last run-in with the development team ending up with the status quo (an objectionable warning) continuing. If some customers reported it as bogus too, it would help -- when R&D people report an issue, it doesn't count because "it isn't a customer report". On Fri, Nov 7, 2008 at 9:34 AM, Art Kagel <art.kagel@gmail.com> wrote: > Oops missed the bottom or your post. The actual problem is that you > #defined the size of the array. Either change that to EXEC SQL DEFINE ....; > or add the compile time option to run the "C" preprocessor BEFORE the ESQL/C > compiler rather than after. > > Art > > On Fri, Nov 7, 2008 at 12:32 PM, Art Kagel <art.kagel@gmail.com> wrote: > >> You have a pointer to an array being used as a host variable for a char >> column rather than an array of char. Since the compiler doesn't know how >> wide the array is it is warning you that it has to assume that the memory >> that the pointer addresses will be wide enough to hold the incoming >> character data which may cause memory corruption if indeed you did not >> allocate a large enough block of memory. The older ESQL compilers did not >> detect or warn about this clear coding error, the new SDK does. That's >> all. If your code is good ignore it, if it is not fix it. If it should be >> passing an array rather than a pointer, fix that. >> >> Art >> >> >> On Fri, Nov 7, 2008 at 9:51 AM, LAKSHMI DEVI PALANISSAMY < >> lakshmidevip@hcl.in> wrote: >> >>> Hi, >>> >>> We are using IDS 11.0 under REHL 5.0 >>> >>> When we comipled the ec files that were developed under Informix 5.0, we >>> are >>> getting the below error >>> "Warning -33208: Runtime error is possible because size of >>> 'create_fin_time1' >>> is unknown" >>> >>> When we searched in internet, we found the below information >>> "esqlc:warning -33208 Runtime error is possible because size of >>> host-variable-name is unknown. >>> This message is a warning only; compilation continues. ESQL/C does not >>> know >>> the size of the host character variable. If the variable is used in an >>> INTO >>> clause, memory might be overwritten. Specify the variable as a character >>> array >>> with a numeric size. The numeric size can be a literal value or an ESQL/C >>> macro value" >>> >>> Also we found the below release notes, >>> * This functionality is addressed in Version 6.0. >>> >>> B28011: GLOBAL ARRAYS WITH DEFINES OR ADDITIONS WILL GIVE WARNING >>> >>> 33208 ON COMPILE. LOCAL ARRAYS WORK FINE. >>> >>> This problem may occur if you have a global array in an ESQL/C >>> >>> program defined as: >>> >>> 1. myvar[1 + 1] >>> >>> 2. myvar[MYDEF + 1] where (either #define or ) >>> >>> 3. myvar[MYDEF] where (#define MYDEF & not MYDEF) >>> >>> Is there any way we would like to retain the size variable in a header >>> file >>> and still dont want the esqlc compiler to throw an error. >>> >>> Any help appreciated. >>> >>> >>> >>> > ******************************************************************************* >>> Forum Note: Use "Reply" to post a response in the discussion forum. >>> >>> >> >> >> -- >> Art S. Kagel >> Oninit (www.oninit.com) >> IIUG Board of Directors (art@iiug.org) >> >> Disclaimer: Please keep in mind that my own opinions are my own opinions >> and do not reflect on my employer, Oninit, the IIUG, nor any other >> organization with which I am associated either explicitly or implicitly. >> Neither do those opinions reflect those of other individuals affiliated >> with any entity with which I am affiliated nor those of the entities >> themselves. >> >> > > -- > Art S. Kagel > Oninit (www.oninit.com) > IIUG Board of Directors (art@iiug.org) > > Disclaimer: Please keep in mind that my own opinions are my own opinions and > do not reflect on my employer, Oninit, the IIUG, nor any other organization > with which I am associated either explicitly or implicitly. Neither do > those opinions reflect those of other individuals affiliated with any entity > with which I am affiliated nor those of the entities themselves. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/ "Blessed are we who can laugh at ourselves, for we shall never cease to be amused." NB: Please do not use this email for correspondence. I don't necessarily read it every week, even.