Opened 7 years ago

Closed 7 years ago

#12 closed defect (fixed)

Excess elements in struct initializer

Reported by: a3moss Owned by: Rob Schluntz <rschlunt@…>
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:


If I try to default-construct a struct with no elements using an empty initializer, the generated code inserts a zero into the initializer, making a warning -- GCC finishes silently on the same code:

struct tag {};

int main() {
    struct tag t = {};


CFA Version 1.0.0 (debug)
tag_struct.c: In function ‘__main__Fi___1’:
tag_struct.c:5:33: warning: excess elements in struct initializer
tag_struct.c:5:33: note: (near initialization for ‘__t__4stag_2’)

Change History (1)

comment:1 Changed 7 years ago by Rob Schluntz <rschlunt@…>

Owner: set to Rob Schluntz <rschlunt@…>
Resolution: fixed
Status: newclosed

In 01b9928:

permit empty initializer lists [fixes #12]

Note: See TracTickets for help on using tickets.