mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Don't need to explain [1] kluge anymore in xfunc.sgml.
This commit is contained in:
parent
2e211211a7
commit
0627eff360
@ -1885,17 +1885,12 @@ typedef struct
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32 length;
|
int32 length;
|
||||||
char data[1];
|
char data[FLEXIBLE_ARRAY_MEMBER];
|
||||||
} text;
|
} text;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
Obviously, the data field declared here is not long enough to hold
|
The <literal>[FLEXIBLE_ARRAY_MEMBER]</> notation means that the actual
|
||||||
all possible strings. Since it's impossible to declare a variable-size
|
length of the data part is not specified by this declaration.
|
||||||
structure in <acronym>C</acronym>, we rely on the knowledge that the
|
|
||||||
<acronym>C</acronym> compiler won't range-check array subscripts. We
|
|
||||||
just allocate the necessary amount of space and then access the array as
|
|
||||||
if it were declared the right length. (This is a common trick, which
|
|
||||||
you can read about in many textbooks about C.)
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user