public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32588]  New: Bogus "error: initializer element is not constant"
@ 2007-07-02 16:12 bero at arklinux dot org
  2007-07-02 17:32 ` [Bug c/32588] " pinskia at gcc dot gnu dot org
  2008-11-14 23:32 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: bero at arklinux dot org @ 2007-07-02 16:12 UTC (permalink / raw)
  To: gcc-bugs

The following code (extracted from ffmpeg) produces "error: initializer element
is not constant":

typedef struct {
    int num;
    int den;
} AVRational;

static AVRational frame_rate = (AVRational) {25,1};

Replacing the last line with plain

static AVRational frame_rate = {25,1};

fixes it -- but shouldn't those lines be identical? They produced identical
code (and no warnings) with older gccs.


-- 
           Summary: Bogus "error: initializer element is not constant"
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bero at arklinux dot org
 GCC build triplet: i586-pc-linux-gnu
  GCC host triplet: i586-pc-linux-gnu
GCC target triplet: i586-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32588


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/32588] Bogus "error: initializer element is not constant"
  2007-07-02 16:12 [Bug c/32588] New: Bogus "error: initializer element is not constant" bero at arklinux dot org
@ 2007-07-02 17:32 ` pinskia at gcc dot gnu dot org
  2008-11-14 23:32 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-02 17:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-07-02 17:32 -------
Actually (AVRational) {25,1} is a compound literal but not a constant.

What options are you using?  It is a GCC extension this is a constant really. 
Now we do error out for -std=gnu99.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32588


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/32588] Bogus "error: initializer element is not constant"
  2007-07-02 16:12 [Bug c/32588] New: Bogus "error: initializer element is not constant" bero at arklinux dot org
  2007-07-02 17:32 ` [Bug c/32588] " pinskia at gcc dot gnu dot org
@ 2008-11-14 23:32 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-14 23:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-11-14 23:31 -------
As mentioned it is only a GCC extension that the value is a constant.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32588


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-14 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-02 16:12 [Bug c/32588] New: Bogus "error: initializer element is not constant" bero at arklinux dot org
2007-07-02 17:32 ` [Bug c/32588] " pinskia at gcc dot gnu dot org
2008-11-14 23:32 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).