-byteswapio does not do the conversion


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.

Linux has entry and exit areas in their object files so that
any object can force a routine to be executed before starting the app, and also force
a routine to execute before exiting the program.

We di d not know how to do this is Windows, so we ask users to
insert the call pghpf_init(&zz) to initialize things, and force certain
routines to be linked.

I think we have figured things out recently to where we can eliminate this
in windows as well as Linux.