[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
-std=gnu99 and casted empty srtuct initializers
From: |
marcus |
Subject: |
-std=gnu99 and casted empty srtuct initializers |
Date: |
17 Sep 2002 13:18:26 -0000 |
>Category: c
>Synopsis: -std=gnu99 and casted empty srtuct initializers
>Confidential: no
>Severity: serious
>Priority: medium
>Class: rejects-legal
>Submitter-Id: net
>Originator: Marcus Brinkmann
>Release: gcc (GCC) 3.2 (20020809) Debian prerelease
>Environment:
i386-gnu
>Description:
This bug only occurs with -std=gnu99.
Initializing an empty struct with an empty struct does not
work if the empty struct is explicitely casted to the struct
type. GCC bails out with "initializer element not constant"
>How-To-Repeat:
Compile the following code with "gcc -std=gnu99":
typedef struct { } foo_t;
/* This one works. */
foo_t bar = { };
/* This one fails with "initializer element is not constant. */
foo_t baz = (foo_t) { };
int
main ()
{
return 0;
}
>Fix:
>Unformatted:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- -std=gnu99 and casted empty srtuct initializers,
marcus <=