sqlexit call under 4GL/ESQL
Posted in 1997
Topics: High Availability & Replication, Connectivity: ESQL/C, 4GL & Embedded SQL
We have recently made the jump from RDS 4.x (SunOS 4.1/OnLine 5.01) to RDS6.x (Solaris 2.5/OnLine 7.21) and had some problem with calls to sqlexit from 4GL. It seems that the new 4GL version of sqlhdr.h will declare sqlexit as void sqlexit();, but the ESQL version of the same sqlhdr.h file declares it as int sqlexit(); When using c4gl, and the C compiler in ANSI-mode, any program that uses sqlexit will not compile, since 4gl attempts to assign the return code to an int variable, but the C compiler is being told that sqlexit does not return any value. It seems we have three options: 1) Edit the sqlhdr.h file and change the return type from void to int 2) Don't set the C compiler flag to compile in ANSI C. This will prevent __STDC__ from being defined, an the function declaration for sqlexit (and ALL the function prototypes) will automatically be ifdef'd away, resulting in the compiler ASSUMING that sqlexit's return type is int, so the code will compile. 3) Write an esql/c interface program that handles the call to sqlexit under ESQL/C with the function that returns int. A problem with all of these options is the actual linked version of sqlexit is probably from the 4GL library, not the ESQL library. Can anybody shed some light as to what is really going on here? Paul.