arocc icon indicating copy to clipboard operation
arocc copied to clipboard

MSVC style zero length arrays error.

Open TwoClocks opened this issue 3 years ago • 0 comments

Neither Clang, nor ARO like this code

typedef int J[];

struct J_size {
    char a[sizeof(J)+1];
    char b;
};

Both error with invalid application of 'sizeof' to an incomplete type 'J' (aka 'int []') even when with -fms-extensions -fms-compatibility set.

But MSVC thinks it's valid:

https://godbolt.org/z/arzxq19sj

TwoClocks avatar Jul 06 '22 09:07 TwoClocks