[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] zero length last member

From: Yakov
Subject: [Tinycc-devel] zero length last member
Date: Tue, 23 Feb 2021 12:36:54 +0700


I have tried the last zero length member extension in tcc and
compilation succeeded but the program crashes, is this a bug or a
different implementation? Btw if you do not know this is a super
useful extension.

typedef struct {
    int size;
    int data[];
} T;

void main(){
    T *t = malloc(500);
    t->size = 2;
    t->data[0] = 100;
    t->data[1] = 200;
    printf("%i %i %i\n", t->size, t->data[0], t->data[1]);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]