Re: Unwarrented warning from ESQL/C 5.00
Posted in 1993
In article <21hc37INN66v@emory.mathcs.emory.edu> unifi!goofy.unifi.com!bharat@uunet.UU.NET (Bharat Shah) writes: >Netters, > >We are currently in the process of upgrading our products to use latest >Informix offerings. While attempting to upgrade from ESQL/C 4.00 to 5.00 >I came across the following irritating :-( pre-compiler 'esql' warning. > >esqlc: "try.ec", line 21: Warning -33208: >Runtime error is possible because size of '(aa_t).name' is unknown. >esqlc: "try.ec", line 21: Warning -33208: >Runtime error is possible because size of '(aa_t).flag' is unknown. >2 warning(s) > >It seems that the pre-compiler is so 'dumb' that it cannot resolve the >embedded defines. In a large development as ours - I have no way to eliminate >defines and replace them with their numeric equivalent. (by the way $define >is also not resolved & the same warning crops up). > >Apart from being unable to resolve defines 'esql' also fails to resolve >fixchar definitions!! I would have thought that fixchar being its own baby >esql should be able to resolve its space requirement. > >As a result of this particular warning our nightly build now generates over >1000 warnings which should never have been. > >My question therefore is > >a. How to change my code so as to eliminate this warning > cannot eliminate define, cannot eliminate structures >b. How to tell pre-compiler to ignore (not generate) this warning. > >Compile the following code as "esql try.ec" to generate the above warnings. > >O > \\/_____ C U T _____ C U T _____ C U T _____ C U T _____ C U T _____ C U T ___ > /\\ >O >#include <stdio.h> >$include sqlca; > >/* ---------------------------- Globals ------------------------------------ */ > >#define NAME_LEN 15 > >$struct aa_t >{ > string name[NAME_LEN+1]; /* 16 instead of NAME_LEN works */ > fixchar flag; /* char instead of fixchar gives > * W3 level warning during actual compile > */ >} >aa_t; > >/* ---------------------------- Routines ------------------------------------ */ > >void main() >{ > $database acd; > $select username, deleted into $aa_t from users > where printname = "Administrator"; > if (! sqlca.sqlcode) printf("Name %s Flag :%c:\\n", aa_t.name, aa_t.flag); > $close database; >} We plan to add a compile option eliminating these warnings in a future release. Note, planned features are subject to change without notice. Also, occassionaly, error -33208 will generate an error instead of a warning, incorrectly. This has become Bug 18640, appearing in 5.01.UC1. Craig These are my personal opinions, not necessarily those of Informix. >#========================================================================= ># Informix-OnLine 5.00.UD5 SCO 3.2 ># Informix-Isql 4.11 AST 486/33 ># Informix-Esql/C 4.00 (upgrading to 5.00) ># Wingz 1.10 ># ># Bharat Shah Voice: (508)-663-7570 ># Unifi Communications Corp. Fax: (508)-663-7543 ># 4 Federal St, Billerica, Mass 01821, USA bharat@unifi.com >#========================================================================= -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Craig Browning Regency Support Informix Software, Inc.