Interestingly, I've seen code that uses the flexible array member idiom with MSVC. I'm fairly certain I first saw this in the windows code base when I worked at MS, and I believe it may even be in some public headers somewhere. In order to compile on MSVC, the trick uses MemberName[0] or MemberName[1] rather than the standard MemberName[]. GCC and clang warn about this. I suspect it might have been a common idiom in pre-C99 days.
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).
> I suspect it might have been a common idiom in pre-C99 days.
There is a Blog from Raymond on this[1]. The TL;DR: is that zero length arrays and FAMs weren't legal until C99. Not sure where the support from MSVC factors in. But that's the story and AFAIK he's sticking too it.