Allow newunit to allocate an integer variable

There’s a related concept (I think) in which an unallocated character string can’t be used for the iomsg argument of the open statement. The issue is that the max/actual length of iomsg is unknown, so fixed-length and preallocation are not good solutions.

Under the hood does it make sense though? My understanding is that these would be passed by reference, so passing an unallocated variable as an argument has no meaning. Would you require the compiler to identify such a case and implicitly allocate it before passing? But if it’s allocated before passing, how would the compiler ensure the allocation conforms with what the called function needs?