]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gcc/extensions-to-the-c-language-family/non-constant-initializers.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gcc / extensions-to-the-c-language-family / non-constant-initializers.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. index:: initializers, non-constant, non-constant initializers
7
8.. _initializers:
9
10Non-Constant Initializers
11*************************
12
13As in standard C++ and ISO C99, the elements of an aggregate initializer for an
14automatic variable are not required to be constant expressions in GNU C.
15Here is an example of an initializer with run-time varying elements:
16
17.. code-block:: c++
18
19 foo (float f, float g)
20 {
21 float beat_freqs[2] = { f-g, f+g };
22 /* ... */
3ed1b4ce 23 }