Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0627eff

Browse files
committed
Don't need to explain [1] kluge anymore in xfunc.sgml.
1 parent2e21121 commit0627eff

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

‎doc/src/sgml/xfunc.sgml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,17 +1885,12 @@ typedef struct
18851885
<programlisting>
18861886
typedef struct {
18871887
int32 length;
1888-
char data[1];
1888+
char data[FLEXIBLE_ARRAY_MEMBER];
18891889
} text;
18901890
</programlisting>
18911891

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.)
1892+
The <literal>[FLEXIBLE_ARRAY_MEMBER]</> notation means that the actual
1893+
length of the data part is not specified by this declaration.
18991894
</para>
19001895

19011896
<para>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp