This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Compatibility between gcc and g77 : Pointer problem ?


>Why on earth do we get negative adresses with g77?

Because you're printing them out using the wrong printf format.  Use
%lu (or %p?) instead of %ld.  You shouldn't care, otherwise, about
the precise values of the pointers, unless you're looking at that in
regards to some *real* bug.

BTW, when trying fort77, which I believe invokes f2c, did you try
the `-a' option?  You might want to read up on that in the f2c
manpage, as well as the `-fno-automatic' option g77 offers to
provide what f2c provides as a default.  That might give you some
insight as to why the addresses seem so different.

>We also have problems freeing memory.

We'd need an example of it not working to be of much help.  But, if
you're relying on addresses of variables having particular properties
as your bug-report perhaps suggests, then I can imagine that you'd
have problems in any home-grown memory management you've implemented
in some combination of Fortran and C.

(Keep in mind, g77 does not offer any *heap*-based memory management.
Automatic arrays are the only way to get dynamic memory allocation in
g77, currently.  If you're having a problem with *that*, by all means,
submit a bug report!)

        tq vm, (burley)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]