Re: ANSI compiling of PRO*C complains
Date: Fri, 21 Jan 1994 13:57:10 GMT
Message-ID: <CJzG3B.Fzz_at_mach1.wlu.ca>
In article <tssmithCJyBGv.F4y_at_netcom.com> tssmith_at_netcom.com (Tim Smith) writes:
>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.
>
Yes, but why sould we have to do this? We are changing over and we have
oh say 400 programs that we would have to make this little 'lie' in.
We would need this on all strlen, strcmp, strcpy, strncpy, etc. etc.
We've even consider a byte hack on the proc executable so it doesnt add the unsigned (by the way it works!) but I dont think Oracle will support such a move.
BTW, why do they have 'code=ansi' if the above bombs (ie. warns) ? Received on Fri Jan 21 1994 - 14:57:10 CET