Re: Compilation Errors
Posted in 1996
Are you running on SCO Unix? You're certainly using an ANSI C compiler with 6.0x I4GL, but it might have been helpful to say so. The problem is that the functions you cite are declared to take 'const char **cmdtxt' arguments (in fact, there are four such functions: _iqcdcl(), _iqexproc(), _iqslct() and _iqstmnt()), but the code passes in the variable 'const char *array[]'. If you are very familiar with Standard C and/or have read the 'C Programming FAQs' by Steve Summit (item 11.10), you'll know that you can't pass a 'char **' to a function which expects a 'const char **', which is what the code actually does. Some compilers are good enough to detect it -- most aren't. At least, I think that is what the problem is; I'm not sure I fully understand the explanation in 'C Programming FAQs', which bothers me a little. Workarounds? Since the C code which implements the _iqcdcl() etc functions still uses no prototypes (nor the keyword const), it is safe to edit incl/esql/sqlhdr.h to remove the 'const' keywords where 'const char **' is the type. And, indeed, the 7.20 sqlhdr.h declares all the functions except _iqstmnt() without the 'const' keyword, recognizing your problem. I suspect that _iqstmnt() is an oversight -- I'm looking at pre-release code, and it may be fixed before it is released. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: kimgeiger@aol.com (Kim Geiger) >Date: 14 Mar 1996 10:15:40 -0500 >X-Informix-List-Id: <news.22115> > >I have a number of 4GL programs that compile and execute fine in RDS. When >I compile them (from the command line) with c4gl, I get the following >warnings: > >C4090: different 'const/volatile' qualifier >C4024: '_iqcdcl' : different types: parameter 3 >C4024: '_iqslct' : different types: parameter 2 > >There are usually at least 10 of each of these errors and sometimes many >more for each program. The program still compiles and seems to run fine. >What are these warnings? Can they be safely ignored? If so, is there >anyway to suppress them?