Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Pro*C generates code that generates a compiler warning about argument 2 (sqlctx) in call to sqlcxt() in generate source files ...
Howdy all,
Consider for a moment the following code file:
#include <sqlca.h>
int dummy()
{
EXEC SQL DELETE FROM X WHERE F1=10;
return(1);
}
This, to me seems like a perfectly valid .pc file (albeit a bit sparse).
I precompile this file using the following proc invocation:
/jazb/app/oracle/product/8.1.5/bin/proc include=/include
include=/usr/include include=include include=../../include include=../../include/src include=/usr/lib/gcc-lib/i386-glibc20-linux/egcs-2.90.29/include include=/jazb/app/oracle/product/8.1.5/precomp/publicltype=none code=ansi_c iname=test.pc
I then compile it using the following gcc invocation:
gcc -ansi -Wall -DLINUX -D_GNU_SOURCE -D_SVID_GETTOD -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DREENTRANT -DNS_THREADS -Iinclude -I../../include -I/jazb/app/oracle/product/8.1.5/precomp/public -ctest.c
When I do this, a warning is generated ...
Pro*C/C++: Release 8.1.5.0.0 - Production on Tue Nov 9 00:47:12 1999
(c) Copyright 1999 Oracle Corporation. All rights reserved.
System default option values taken from: /jazb/app/oracle/product/8.1.5/precomp/admin/pcscfg.cfg
test.c: In function `dummy':
test.c:159: warning: passing arg 2 of `sqlcxt' discards `const' from
pointer target type
I can see why the warning is generated; the following code snipettes
generated by Pro*C are taken
from the test.c file:
static const unsigned int sqlctx = 1;
extern void sqlcxt (void **, unsigned int *,
struct sqlexd *, const struct sqlcxp *);
sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
My question is...
Why is PRO*C coding things this way? Is this a bug?
Any help expunging this annoyance would be greatly appreciated!
Ciao.
P.S. My environment is:
Redhat LINUX 6.0 kernel 2.2.5-15 glibc 2.1.1-6 gcc egcs-2.91.66 19990314/Linux (egcs-1.1.2release)
Oracle 8.1.5 for LINUX Received on Mon Nov 08 1999 - 22:50:43 CST
![]() |
![]() |