gfortran question about optional subroutine arguments
Mark Hounschell
markh@compro.net
Thu Mar 14 14:28:00 GMT 2013
On 03/14/2013 10:03 AM, Tim Prince wrote:
> On 3/14/2013 9:39 AM, Mark Hounschell wrote:
>>
>> When I use -std=f95 this fortran77 code will not compile. Many
>> different complaints but the most serious are normal variable
>> declarations:
>>
>> INTEGER*8 TOTTIME(0:MAXTASK) ! Task total exec time (
>> 1
>> Error: Nonstandard type declaration INTEGER*8 at (1)
>>
>> ????
>>
> Are you hoping to amend the F77 standard retroactively to get this
> extension accepted as standard in a round-about way? 24-, 36-, and
> 60-bit machines were still in use when F77 was under development, so
> there was no meaningful way to incorporate an extension which was
> designed to prevent code from being portable to any but 16- and 32-bit
> (or some 64-bit) platforms.
> It's true that the f77 standard didn't require an option to reject this
> syntax, but many f77 compilers did reject it. The fact that some
> accepted it doesn't make it fortran77.
> If you intend to keep your application restricted to the majority of
> current platforms where integer*8 and integer(8) are synonymous, the
> latter will probably pass standards checking, even though replacing the
> 8 by a parameter constant would be preferable.
>
No I'm not hoping to amend any standard. I have been using different
vendors flavours of fortran 77 since the mid 70s. This is how it's done
on every one I ever used. I assumed it was standard and can hardly
believe it isn't. This code BTW was actually written on a fortran77 I
never had used until I got this project and it was standard for them
also? I've never even seen an "integer(8) param" before.
The point is, Tobias said that anything that builds using -std=legacy
should also build using -std=f95. And that I should be able to use the
f95 method of optional variables. When using -std=legacy this builds
just fine so I assume even gfortran understands this as standard. If so,
and gfortran is backwards compatible as I was told, then integer*8
should be OK using -std=f95 also. Why is it not?
Did I read something wrong in Tobias response to my OP?
Thanks
Mark
More information about the Gcc-help
mailing list