This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Compatibility between gcc and g77 : Pointer problem ?
- To: leininge at pqtlx2 dot ups-tlse dot fr
- Subject: Re: Compatibility between gcc and g77 : Pointer problem ?
- From: craig at jcb-sc dot com
- Date: 15 Jun 1999 12:04:30 -0000
- Cc: egcs-bugs at egcs dot cygnus dot com
- Cc: craig at jcb-sc dot com
- References: <99061512532201.14333@pqtlx2.ups-tlse.fr>
>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)