P
pete
Simon said:It's not valid, and gcc produces the diagnostic message "initializer
element is not constant"
when compiled with exactly the options you give.
C99
6.7.8 Initialization
[#4] All the expressions in an initializer for an object
that has static storage duration shall be constant
expressions or string literals.
6.6 Constant expressions
[#7] More latitude is permitted for constant expressions in
initializers. Such a constant expression shall be, or
evaluate to, one of the following:
-- an arithmetic constant expression,
-- a null pointer constant,
-- an address constant, or
-- an address constant for an object type plus or minus an
integer constant expression.
[#8] An arithmetic constant expression shall have arithmetic
type and shall only have operands that are integer
constants, floating constants, enumeration constants,
character constants, and sizeof expressions.