Commit d615d763 by Marek Polacek Committed by Marek Polacek

re PR c/37428 (GNU VLA-in-structure extension is undocumented)

	PR c/37428
	* doc/extend.texi (C Extensions): Mention variable-length arrays in
	a structure/union.

From-SVN: r208836
parent 1b226529
2014-03-26 Marek Polacek <polacek@redhat.com>
PR c/37428
* doc/extend.texi (C Extensions): Mention variable-length arrays in
a structure/union.
2014-03-26 Marek Polacek <polacek@redhat.com>
PR c/39525
* doc/extend.texi (Designated Inits): Describe what happens to omitted
field members.
......
......@@ -1592,6 +1592,18 @@ Jumping or breaking out of the scope of the array name deallocates the
storage. Jumping into the scope is not allowed; you get an error
message for it.
@cindex variable-length array in a structure
As an extension, GCC accepts variable-length arrays as a member of
a structure or a union. For example:
@smallexample
void
foo (int n)
@{
struct S @{ int x[n]; @};
@}
@end smallexample
@cindex @code{alloca} vs variable-length arrays
You can use the function @code{alloca} to get an effect much like
variable-length arrays. The function @code{alloca} is available in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment