Re: pro*C parser bug?

From: Jodi Showers <jshowers_at_cmi.on.ca>
Date: Wed, 9 Nov 1994 14:04:36 GMT
Message-ID: <jshowers-0911940901390001_at_mac25.cmi.on.ca>


> In article <39gqur$mq6_at_tequesta.gate.net> gnd_at_gate.net "Gregory Dora" writes:
>
> > Why does my pro*c precompiler change a VARCHAR declaration?
> >
> > It turns VARCHAR foo[5000][12]; from the .pc source to
> > struct
> > {
> > char arr[14];
> > int len;
> > }foo [5000];
> > in the generated .c file.
> >

And In article Paul Beardsell <psb_at_sambusys.demon.co.uk> wrote
>
> Perhaps Pro*C is deciding to have each element of the array start on
> a 4 byte boundary?
>

Pg. 1-23, Pro*C Supplement to the Oracle Precompilers Guide "...the precompiler may add bytes to the array member of a VARCHAR host array to make sure it is word-aligned. For example, the declaration

VARCHAR ename [100][10];

might be expanded into the following struct:

struct {
  unsigned short len;
  unsigned char arr[12];
} ename[100];
"

As word lengths are hardward/platoform dependent, you may find a little different 'c' code across identical 'pc' source.

Jodi.

> --
> Paul Beardsell SAM Business Systems Ltd
> ~~~~~~~~~~~~~~ 21 Finn House, Bevenden St,
> pbeardsell_at_cix.compulink.co.uk London, N1-6BN, UK.
> psb_at_sambusys.demon.co.uk (+44 or 0)71 608-2391
Received on Wed Nov 09 1994 - 15:04:36 CET

Original text of this message