We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent2e21121 commit0627effCopy full SHA for 0627eff
doc/src/sgml/xfunc.sgml
@@ -1885,17 +1885,12 @@ typedef struct
1885
<programlisting>
1886
typedef struct {
1887
int32 length;
1888
- char data[1];
+ char data[FLEXIBLE_ARRAY_MEMBER];
1889
} text;
1890
</programlisting>
1891
1892
- Obviously, the data field declared here is not long enough to hold
1893
- all possible strings. Since it's impossible to declare a variable-size
1894
- structure in <acronym>C</acronym>, we rely on the knowledge that the
1895
- <acronym>C</acronym> compiler won't range-check array subscripts. We
1896
- just allocate the necessary amount of space and then access the array as
1897
- if it were declared the right length. (This is a common trick, which
1898
- you can read about in many textbooks about C.)
+ The <literal>[FLEXIBLE_ARRAY_MEMBER]</> notation means that the actual
+ length of the data part is not specified by this declaration.
1899
</para>
1900
1901
<para>