I have a peculiar scenario where I am trying to read an unformatted file in fortran using Open and Read. I use the -byteswapio flag which works only if the main function is in a Fortran file. The same -byteswapio works if the main function is in a Fortran file.
The fix for this is essentially this: I added a call to pghpf_init(&zz); in my C main function where zz is a global static variable initialized to 0.
Can someone please tell me how this works? I am running my program on the Interix sub system on Windows Xp.