Moving Bits Question

To @ivanpribec , cc: @RonShepard

Since you gave a like to the post, can we presume you understand the issue and the point being raised by @RonShepard in this thread? If that is true, can you please illustrate it as per your understanding, preferably using code that you have run on different platforms including those with different order of byte sequences?

So you have the C interop approach shown upthread: and the program output shown there where the hexadecimal output is the same.

Now consider the TRANSFER intrinsic:

   use, intrinsic :: iso_fortran_env, only : int32, int64
   integer(int32) :: i32(2)
   integer(int64) :: i64
   i32(2) = int(z'01020304', int32)
   i32(1) = int(z'05060708', int32)
   i64 = transfer( source=i32, mold=i64 )
   write(*,'(*(b32.32))') i32(2), i32(1)
   write(*,'(b64.64)') i64
end               
C:\temp>gfortran p.f90 -o p.exe

C:\temp>p.exe
0000000100000010000000110000010000000101000001100000011100001000
0000000100000010000000110000010000000101000001100000011100001000

So now put yourself in the shoes of someone on the standards committee who is looking at suggestions for changes in the language and they come across this on MVBITS: what exactly is the problem your think that committee member should ask the committee to address as needing to be solved in the language?

What is “the missed opportunity” here?

Sure, going from a processor with the above byte-ordering sequence to another processor with another sequence, the pattern of bits will be different. But how is that of any consequence?

In a given program with a processor, a round-trip TRANSFER operation or the pack/unpack steps will show no bit-hysteresis. So what exactly is the problem here?