You are probably confusing flexible array members with VLA. Those are two completely different features. You are thinking about the one where last member of struct is an array and you adjust size based on malloc size when allocating struct. VLA feature allows you specifying arbitrary non constant expression when declaring local stack variables with array type. Something like:
// VLA
int foo(int n) {
int array[n];
}
// flexible array member
struct s { int n; double d[]; };
struct s s1 = malloc(sizeof (struct s) + (sizeof (double) 8));
Flexible array members were implemented a long time ago. The oldest Visual C++ I have at hand is 2005 and it already has them (although only in C mode).
// VLA
int foo(int n) { int array[n]; }
// flexible array member
struct s { int n; double d[]; }; struct s s1 = malloc(sizeof (struct s) + (sizeof (double) 8));