Re: Pro*C and Pointers are not assignment compatiable

From: John Ennis <john_at_pjpsoft.com>
Date: 1997/02/13
Message-ID: <33027A4B.AF8_at_pjpsoft.com>#1/1


Scott T. Johnson wrote:
>
> I am working on a Pro*C program and cannot get rid of the following
> warning. My Pro*C call is included as well as the code. I am running
> on an HP using HP-UX 9.04 and the generic C compiler that comes with the
> OS.
>
> Thanks,
> Scott
>
> /orax2/oracle/7.2/bin/proc sqlcheck=full iname=p.pc
>
> Pro*C/C++: Release 2.1.3.0.0 - Production on Wed Feb 12 07:03:51 1997
>
> Copyright (c) Oracle Corporation 1979, 1994. All rights reserved.
>
> System default option values taken from: /orax2/oracle/7.2/proc/pmscfg.h
>
> cc -I. -O -Aa -D_HPUX_SOURCE +ESsfc +ESlit
> -I/orax2/oracle/7.2/sqllib/pc
> cc: "p.c", line 209: warning 604: Pointers are not
> assignment-compatible.
> cc: "p.c", line 209: warning 563: Argument #1 is not the correct type.
> cc: "p.c", line 210: warning 604: Pointers are not
> assignment-compatible.
> cc: "p.c", line 210: warning 563: Argument #1 is not the correct type.
> cc: "p.c", line 213: warning 604: Pointers are not
> assignment-compatible.
> cc: "p.c", line 213: warning 563: Argument #1 is not the correct type.
> cc: "p.c", line 214: warning 604: Pointers are not
> assignment-compatible.
> cc: "p.c", line 214: warning 563: Argument #1 is not the correct type.
> cc: "p.c", line 215: warning 604: Pointers are not
> assignment-compatible.
>
> Sample Code:
>
> void main(int argc, char **argv)
> {
>
> EXEC ORACLE OPTION (ORACA=YES);
> VARCHAR sqlstmt[150];
> VARCHAR v_prodcode[10];
> VARCHAR prodcode[10];
>
> /* The ORACA=YES option must be specified to enable use of
> * the ORACA.
> */
>
> oracle_login("/");
>
> strcpy(sqlstmt.arr, "SELECT PROD_CODE FROM PP_PRODUCT WHERE PROD_CODE");
> strcat(sqlstmt.arr, " = :v1");

Scott,

Although I haven't tried it, Im sure that casting the varchar will clear the message :

                strcpy( (char *)sqlstmt.arr, "Select ...");

john_at_pjpsoft.com Received on Thu Feb 13 1997 - 00:00:00 CET

Original text of this message