git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2e21121)
Don't need to explain [1] kluge anymore in xfunc.sgml.
2015年2月21日 21:29:45 +0000 (16:29 -0500)
2015年2月21日 21:29:45 +0000 (16:29 -0500)

diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index f40504c481630fe31378e07eaccae6d0667a1d9d..97a56562d3e40293b8bee91df37de90f974844a2 100644 (file)
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -1885,17 +1885,12 @@ typedef struct
<programlisting>
typedef struct {
int32 length;
- char data[1];
+ char data[FLEXIBLE_ARRAY_MEMBER];
} text;
</programlisting>
- Obviously, the data field declared here is not long enough to hold
- all possible strings. Since it's impossible to declare a variable-size
- 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.)
+ The <literal>[FLEXIBLE_ARRAY_MEMBER]</> notation means that the actual
+ length of the data part is not specified by this declaration.
</para>
<para>
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /