I would expect that to produce an error, though. If I had a regular file that was not infinite in size, and I specified the wrong length for the array, I would find it more useful to have the compiler inform me as to the discrepancy rather than truncate my file.
The preprocessor needs to run before the compiler, though, and isn't complex enough to understand the context of the code that it's in. That would be a substantially complex thing to implement.
This will indeed require delaying population of the array to the compilation stage. However it's worth the convenience and the succinctness of the syntax, and it's not that substantially complex to implement.
Just a random thought, but I'd expect a compiler to do exactly what's described if I tell it:
This would address the most common case with infinity files, and then just let the compiler error out if the array size is not specified.