Re: ANSI compiling of PRO*C complains
Date: Thu, 20 Jan 1994 23:19:43 GMT
Message-ID: <tssmithCJyBGv.F4y_at_netcom.com>
In article <CJxqLM.KAJ_at_mach1.wlu.ca> derwin_at_mach2.wlu.ca (Daryl Erwin) writes:
>We are about to move to a new version of PTX and a new version of the
>compiler. The compiler is supposedly ANSI standard. Anyways, the
>problem is all the warning messages its spits out about varchar's
>'unsigned char arr'. It seems that ay functon on variable.arr complains.
>For instance strlen(variable.arr) will complain because strlen is
>expecting a char not an unsigned char. What are my options?
>
>1) use the old compiler and not use ANSI?
>2) Hard code all varchar definitions to their structure?
>-OR-
>????
Golly, what's wrong with
strlen((char *) variable.arr);
??
Works like a charm. (Oh, and you probably don't want to be doing this strlen after a fetch, because the .arr component is not null-terminated. The length is in variable.len.)
I'm in the process of converting the Pro*C docs sample code to use casts like this.
--Tim (tssmith_at_netcom.com) Received on Fri Jan 21 1994 - 00:19:43 CET