Simple test with failing program

Hello. This is simple test, i’m not sure, if it is something new for discussion.
Simple program:

program test
read(5,N)
end

It fails with segfault on windows. Is it hard for compiler to predict, that such code cannot work? Why it just lets to compile and run it?

Is it hard for compiler to predict, that such code cannot work? Why it just lets to compile and run it?

The compiler can’t validate I/O formatting since it’s evaluated at run time.

  • Mat