This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/9469: gcc-3.2 wont' compile a particular initializer


>Number:         9469
>Category:       c
>Synopsis:       gcc-3.2 wont' compile a particular initializer
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 27 23:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     akpm@digeo.com
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
typedef struct { } spinlock_t;

typedef struct {
        spinlock_t lock;
        unsigned pre_sequence;
        unsigned post_sequence;
} frlock_t;

frlock_t foo = (frlock_t) { (spinlock_t) { }, 0, 0 };   

mnm:/home/akpm> /usr/local/gcc-3.2.1/bin/gcc -S t.c
t.c:10: initializer element is not constant
t.c:10: (near initialization for `foo')
t.c:10: initializer element is not constant


Removing the (spinlock_t) cast makes it go away.  As
does using gcc-2.95.3.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]