gtk_init breaks fortran data operation



Hello.
I'm writing an application, that combines GTK calls (from C source) and fortran subroutine.
Behavior of subroutine depends on when it gets called - before gtk_init or after.
If it is called before gtk_init, subroutine works OK. If subroutine is called after gtk_init, fortran behaves very strange: it reads floating point value from file, but it gets only integer part of it. In first, correct case, it reads normal floating point value.

Code
>printf("This call is correct:\n");
>main_in_ ();
>gtk_init (&args_length1, &args);
>printf("And this is already broken:\n");
>main_in_ ();
Gives following output
>This call is correct:
> dt ==   7.30000019E-11
>And this is already broken:
> dt ==    7.0000000

Why does gtk_init affect fortran way of reading value? How it can be fixed?
Small testcase attached.

Attachment: gtk-fortran.tar.gz
Description: GNU Zip compressed data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]