Re: esqlc generated code wont lint
Posted in 1996
Tom, Your primary problem is that you are using version 4.0 ESQL/C. In fact, none of the pre-6.00 versions of ESQL/C (up to and including 5.07.UC1, anyway) include a complete set of function prototypes in the headers. I have provided in the past a set of headers which fix this deficiency -- look in the IIUG or DejaNews archives for the information. Additionally, the code generator for 4.0 and 4.1x ESQL/C is careless and generates the value '(char *)0' when the function called requires, for example, '(struct value *)0'. This is not easily fixed in the absence of prototypes. You could look at the esql++ script which I've previously posted which allows version 4.0 code to be compiled by a C++ compiler; that gets the function prototypes straight. David, I'm not sure exactly what your problems are, but the llint-lc code on my Sun (Solaris 2.4) does not include a declaration of getpid(), nor of most of the system calls, which is rather odd. I haven't investigated too hard, but I'd hazard a guess that lint is assuming that getpid is defined as a function returning an integer, rather than a pid_t, and is therefore complaining, even though your code is pedantically correct using POSIX.1 types. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: David Williams <djw@smooth1.demon.co.uk> }Date: Thu, 3 Oct 1996 19:29:04 +0100 }X-Informix-List-Id: <news.28861> } }In article <3253E38E.6031@rmi.net>, tom dorgan <amidasws@rmi.net> writes }>why is it on Solaris 5.3 using the sparcworks compiler and esqlc 4.0 }>that my code lints clean but that generated by esqlc gives tons of }>undeclared functions and too many initializer errors? }> } I've tried linting esqlc and lint does not proerly understand C. } It warns about many things which are in actual fact correct. E.g. } } #include<...which vever file contains getpid definition> } pid_t p; } p=getpid(); } } Now getpid returns a pid_t and p is a pid_t but lint will still } complain. Or try } } #include<...which vever file contains getpid definition> } pid_t p; } p = pid_t(1); } } Lint will complain again even though pid_t is normally and int/short } and whatever it is a process id can always be 1 since that is the } process id of init!! } }>Is it some options that esqlc uses for the c compiler or what. Are we }>still using those anachronistic Berkleyisms, boys? }> }>I mean, I cant even compile your generated code using -g options }>to the C compiler. }> } } Probably because you need to specify the correct include directories } since Informix obviously have their own include files installed } somewhere under where Informix is installed. } }>Hoping for an answer which makes me feel better about this tool. }> }>thanks, }>tom. } }-- }David Williams }