??== Variable declared but not used in FORTRAN.

??== Variable declared but not used in FORTRAN.

Post by Hans M. A » Wed, 14 Jul 1999 04:00:00



In VAX FORTRAN the complier warns if a variable has been declared but not used.

How do we obtain this warning in Alpha FORTRAN?

--

 
 
 

??== Variable declared but not used in FORTRAN.

Post by John Brig » Wed, 14 Jul 1999 04:00:00



Quote:> In VAX FORTRAN the complier warns if a variable has been declared but not used.

> How do we obtain this warning in Alpha FORTRAN?

Your choice:

        $ FORTRAN /WARN=DECLARATION

or

        IMPLICIT NONE

Last time I checked, warnings for undeclared variables were not the
default on VAX Fortran.

 
 
 

??== Variable declared but not used in FORTRAN.

Post by Tim Llewelly » Wed, 14 Jul 1999 04:00:00




> > In VAX FORTRAN the complier warns if a variable has been declared but not used.

> > How do we obtain this warning in Alpha FORTRAN?

> Your choice:

>         $ FORTRAN /WARN=DECLARATION

> or

>         IMPLICIT NONE

> Last time I checked, warnings for undeclared variables were not the
> default on VAX Fortran.

But, the original poster wanted to know about variables that are declared but not used,
not the other way round, which of course is a IMPLICIT NONE or FORTR/WARN=DECL
thing.

Tim, who does remember using this feature but its so long since he used Fortran someone
else will have to answer.
--
Tim Llewellyn, OpenVMS System Manager, Remarcs Project
MedAS at the BBC, Whiteladies Road, Bristol, UK.

I speak for myself only and my views in no way represent those of
MedAS or the BBC.

 
 
 

??== Variable declared but not used in FORTRAN.

Post by Brendan Welc » Wed, 14 Jul 1999 04:00:00


Just to be explicit about what is involved, in my practical experience,
knowing these "stray names" is more important in finding misspellings
in the names of variables than in anything else.

IMHO one of the it's-a-feature-not-a-bug of Fortran is that you do
not have to give a type for every variable; just use it.   OK, after a
few edittings there may be a few stray names around; if that
stray name were a variable with a dimension of (999999999), that could
cause a problem to some operating systems, and is a valid reason
for always checking those names and removing them from the coding.
But I claim that the misspelling case is more important.

If neither of these cases apply (i.e. if you can withstand some
imperfect code, in the interest of getting some real answers, quickly)
then you do not even need to know these names.   Your time
and thought are part of the "expense" too.

--
Brendan Welch, system analyst, Univ. of Massachusetts - Lowell, W1LPG

 
 
 

??== Variable declared but not used in FORTRAN.

Post by Pascal Blond » Wed, 14 Jul 1999 04:00:00


"Hans M. Aus" a crit :

Quote:

> In VAX FORTRAN the complier warns if a variable has been declared but not used.

> How do we obtain this warning in Alpha FORTRAN?

On VMS V7.1 FORTRAN compiler, you can use the following switch:

$  fortran /warning=unused program.for

Sincerly.

___  Pascal Blonde _________________________ ICQ: 24454327 ________

Fax: (33/0)1 4325 5542  http://opdaf1.obspm.fr/~pascal/pblonde.html
---------______ LPTF, Observatoire de Paris, France _____----------

 
 
 

??== Variable declared but not used in FORTRAN.

Post by Arne Vajh? » Wed, 14 Jul 1999 04:00:00




> > In VAX FORTRAN the complier warns if a variable has been declared but not used.

> > How do we obtain this warning in Alpha FORTRAN?

> Your choice:

>         $ FORTRAN /WARN=DECLARATION

> or

>         IMPLICIT NONE

> Last time I checked, warnings for undeclared variables were not the
> default on VAX Fortran.

Read the post again.

He wants to find declared but unused variables not used but undeclared
variables.

Arne

 
 
 

??== Variable declared but not used in FORTRAN.

Post by Tim Llewelly » Wed, 14 Jul 1999 04:00:00





> > > In VAX FORTRAN the complier warns if a variable has been declared but not used.

> > > How do we obtain this warning in Alpha FORTRAN?

> > Your choice:

> >         $ FORTRAN /WARN=DECLARATION

> > or

> >         IMPLICIT NONE

> > Last time I checked, warnings for undeclared variables were not the
> > default on VAX Fortran.

> Read the post again.

> He wants to find declared but unused variables not used but undeclared
> variables.

> Arne

Arne, thanks for reassuring me I didn't misread the original post.
Actually, I just found a system to test on,

FORTRAN/WARNINGS=DECLARATIONS only picks the variables
used but not declared. Not what was requested. I used to refuse to debug
student fortrash unless it had IMPLICIT NONE or was compiled
/WARNINGS=DECLARATIONS, btw.

Fortran/warnings=unused flags unued variables, as requested by Hans
M. Aus.

This is Digital Fortran V 7.1.

Regards

--
Tim Llewellyn, OpenVMS System Manager, Remarcs Project
MedAS at the BBC, Whiteladies Road, Bristol, UK.

I speak for myself only and my views in no way represent those of
MedAS or the BBC.

 
 
 

??== Variable declared but not used in FORTRAN.

Post by John Brig » Wed, 14 Jul 1999 04:00:00



Quote:> In VAX FORTRAN the complier warns if a variable has been declared but not used.

> How do we obtain this warning in Alpha FORTRAN?

It has been brought to my attention that my previous response misread
the question.  So rather than trapping used but undeclared variables
with /WARN=DECLARATION, what is desired is trapping declared but unused
variables with:

        /WARN=UNUSED


 
 
 

??== Variable declared but not used in FORTRAN.

Post by Randy Par » Wed, 14 Jul 1999 04:00:00



>In VAX FORTRAN the complier warns if a variable has been declared but not
used.

>How do we obtain this warning in Alpha FORTRAN?

>--


I don't know about Fortran, but in some other languages you can
produce a cross reference, and then inspect the cross reference
for variables that are declared but have no reference, destructive
or non-destructive.
 
 
 

??== Variable declared but not used in FORTRAN.

Post by Hans M. A » Thu, 15 Jul 1999 04:00:00


We're using  Digital Fortran 90 V7.1-330 on our Alpha.

The $help  F90/Warn lists only:

  /WARNINGS=(option[,...])    D=/WAR=(ALI,NODEC,GEN,UNCALL,UNINIT)

/Warnings=ALL is the default.

No warning message appears when I compile a file with a declared but
unused variable using:

$for/warn=unused test

Also, the compiler accepts the keyword "/warn=unused" without an error.

Whereas,

$f90/warn=blabla test.for
%DCL-W-IVKEYW, unrecognized keyword - check validity and spelling
 \BLABLA\

:-|

--

 
 
 

??== Variable declared but not used in FORTRAN.

Post by paddy.o'br.. » Thu, 15 Jul 1999 04:00:00


Hans,

Quote:>In VAX FORTRAN the complier warns if a variable has been declared but not used.

>How do we obtain this warning in Alpha FORTRAN?

I have asked Steve Lionel to include this.  It appears that there are so few of
us who want this that it is not worth their while.  


be nice to know how many Fortran users agree with what I would like -- mostly
the old VAX behaviour.

Regards, Paddy

Paddy O'Brien,
System Planning,
TransGrid,
PO Box A1000, Sydney South,
NSW 2000, Australia

Tel:   +61 2 9284-3063
Fax:   +61 2 9284-3050

Either "\'" or "\s" (to escape the apostrophe) seems to work for most people,
but that little whizz-bang apostrophe gives me little spam.

 
 
 

??== Variable declared but not used in FORTRAN.

Post by paddy.o'br.. » Thu, 15 Jul 1999 04:00:00


Tim LLewellyn wrote"




>> > In VAX FORTRAN the complier warns if a variable has been declared but not
>used.

>> > How do we obtain this warning in Alpha FORTRAN?

>> Your choice:

>>         $ FORTRAN /WARN=DECLARATION

>> or

>>         IMPLICIT NONE

>> Last time I checked, warnings for undeclared variables were not the
>> default on VAX Fortran.

>But, the original poster wanted to know about variables that are declared but
>not used,
>not the other way round, which of course is a IMPLICIT NONE or FORTR/WARN=DECL
>thing.

On Alpha, /warn=unused.

I have asked the Fortran engineering team to make this the default for /old_f77
and F90/F95, as was on VAX.  Since they will not, I assume that there are
powerful people out there who have requested otherwise.

Unless you have specific F90/F95 code, try compiling on a VAX platform to get
better warnings/informationals.  

I hope that eventually the team will give us the warnings we had in their VAX
compiler.

Regards, Paddy

Paddy O'Brien,
System Planning,
TransGrid,
PO Box A1000, Sydney South,
NSW 2000, Australia

Tel:   +61 2 9284-3063
Fax:   +61 2 9284-3050

Either "\'" or "\s" (to escape the apostrophe) seems to work for most people,
but that little whizz-bang apostrophe gives me little spam.

 
 
 

??== Variable declared but not used in FORTRAN.

Post by paddy.o'br.. » Thu, 15 Jul 1999 04:00:00


Hans,

Quote:>We're using  Digital Fortran 90 V7.1-330 on our Alpha.

>The $help  F90/Warn lists only:

>  /WARNINGS=(option[,...])    D=/WAR=(ALI,NODEC,GEN,UNCALL,UNINIT)

>/Warnings=ALL is the default.

>No warning message appears when I compile a file with a declared but
>unused variable using:

>$for/warn=unused test

>Also, the compiler accepts the keyword "/warn=unused" without an error.

>Whereas,

>$f90/warn=blabla test.for
>%DCL-W-IVKEYW, unrecognized keyword - check validity and spelling
> \BLABLA\

Steve Lionel might give you a better reply.

On the June Condist, Fortran has been upgraded to F90/F95.  It also includes
some (but not all) of the things we were used to and loved on the old VAX and
early Alpha F77.

Regarding qualifiers and keywords, I believe that though they are not effective,
all the original keywords are left in place for compatibility.

As a long time user of VAX Fortran and the facilities (qualifiers, etc.) we were
given, I would love to know what VMS Alpha F90/F95 users feel that they are not
getting that we were used to.  Or even what has changed; -I- becomes -W-, etc.
(screws MMS).

I am preparing my own "hit-list" that I intend to send to the Fortran team, and
would love to share with dedicated (Digital - VMS) Fortran users.  Write
privately or to the newsgroup.

Regards, Paddy

Paddy O'Brien,
System Planning,
TransGrid,
PO Box A1000, Sydney South,
NSW 2000, Australia

Tel:   +61 2 9284-3063
Fax:   +61 2 9284-3050

Either "\'" or "\s" (to escape the apostrophe) seems to work for most people,
but that little whizz-bang apostrophe gives me little spam.

 
 
 

??== Variable declared but not used in FORTRAN.

Post by Dr Ivan D Reid, muSR Facili » Thu, 15 Jul 1999 04:00:00




Quote:>On Alpha, /warn=unused.
>I have asked the Fortran engineering team to make this the default for
> /old_f77
>and F90/F95, as was on VAX.  Since they will not, I assume that there are
>powerful people out there who have requested otherwise.
>Unless you have specific F90/F95 code, try compiling on a VAX platform to get
>better warnings/informationals.  

        You don't have to go to a VAX if you have F77.  On our cluster
fortr/warn gives:
======================
FOO$MAIN                                                        
14-JUL-1999 14:02:32  DIGITAL Fortran 77 X7.1-156       Page 1
14-JUL-1999 14:01:15  USR_SCROOT:[REID]FOO.FOR;1

              1         integer a,b,c
                ..................1.2
%FORT-I-VARUNUSED, (1) Variable was declared but not used.

%FORT-I-VARUNUSED, (2) Variable was declared but not used.

              2         real mean
              3
              4         a=3
              5         mean=a
              6         write(*,*)mean
              7         stop
              8         end
[snip]
/WARNINGS=(ALIGNMENTS,ARGUMENT_CHECKING,DECLARATIONS,GENERAL,INFORMATIONAL,
TRUNCATED_SOURCE,UNCALLED,UNINITIALIZED,UNREACHABLE,UNUSED,USAGE)
================
but f90/warn gives:
===============
FOO$MAIN$BLK                    Source Listing                  
14-JUL-1999 14:02:22  DIGITAL Fortran 90 X7.1-574       Page 1
14-JUL-1999 14:01:15  USR_SCROOT:[REID]FOO.FOR;1

              1         integer a,b,c
              2         real mean
              3
              4         a=3
              5         mean=a
              6         write(*,*)mean
              7         stop
              8         end
[snip]
/WARNINGS=(ALIGNMENT,ARGUMENT_CHECKING,DECLARATIONS,GENERAL,GRANULARITY,
TRUNCATED_SOURCE,UNCALLED,UNINITIALIZED,USAGE)

--

  MuSR99 Conference, Les Diablerets: http://www1.psi.ch/~musr99/musr99.html

 
 
 

??== Variable declared but not used in FORTRAN.

Post by Tim Llewelly » Thu, 15 Jul 1999 04:00:00



Quote:

>         You don't have to go to a VAX if you have F77.  On our cluster
> fortr/warn gives:

Yup, I did tests on DEC Fotrans rather than F90 and /warn=unused worked there

--
Tim Llewellyn, OpenVMS System Manager, Remarcs Project
MedAS at the BBC, Whiteladies Road, Bristol, UK.

I speak for myself only and my views in no way represent those of
MedAS or the BBC.

 
 
 

1. ??== Variables passed to an external FORTRAN function displaced.

Why are the variables passed to an external FORTRAN function from a
SQL/Rdb function displaced by one variable?

How can I write a FORTRAN test program that calls the function
send_mess.exe in the same way that the SQL/Rdb function calls the
send_mess.exe?

Open VMS /Alpha 7.2-1, Rdb 7.0.3.1

+++++++

The SQL calling function has only 3 parameters:  send_mess
('aaaaa','bbbbb','ccccc' )
[details below]

I've ended up with 4 parameters in the called test FORTRAN function:

        integer  function send_mess(a ,b,c,d)  return (ia)
        implicit none
        character*(*) a,b,c
        type *, ' 1st parameter a::',a, '::stop'
        type *, ' 2nd parameter b::',b, '::stop'
        type *, ' 3rd parameter c::',c, '::stop'
        type *, ' 4th parameter d::',d, '::stop'

        ia =25
        return
        end

The link file  is:

$link/share send_mess, sys$input:/opt
symbol_vector =( send_mess =procedure)

++++ The interactive SQL procedure is:

SQL> attach 'file my_trig_test';
SQL> insert into aaa(ix,iy) values ('agafg', 1);
1 row inserted
SQL> del from aaa where iy =1;
 1st parameter a::::stop
 2nd parameter b::aaaaa::stop
 3rd parameter c::bbbbb::stop
 4th parameter d::ccccc::stop
1 row deleted

The  trigger on delete  finds the external function but the variables are
displaced by one.

++++++++
My db, external function and trigger definitions are:

create database    filename 'my_trig_test';
create table aaa(ix char(32),iy integer);

create function send_mess (in char(5),in char(5),in char(5))
returns integer by reference;

external name send_mess location 'U1:[AUS.PLAY]send_mess.exe'
language fortran
general parameter style;
commit;

create trigger mtt_delet
        before delete on aaa
        when send_mess ('aaaaa','bbbbb','ccccc' ) <>  0
        (error)
        for each row;
commit;

I'm trying to implement the tracking db  activity with external functions
and triggers shown in examples 14-23 and 14-24 of the Rdb "Guide to SQL
programming" and Oracle Rdb Technical Note Note #8 on "External Functions
in Rdb SQL".

--

2. TCP/IP Over Twinax for win 3.1

3. AXP FORTRAN argument list (variable)

4. Western Electric 320 Unit

5. FORTRAN prog calling C sub with character variable array param

6. Test

7. Q. Variable dimensioning in VAX Fortran.(With IMSL).

8. Is "webifying" a real word?

9. Using INETACP_FUNC$C_GETHOSTBYNAME using fortran- examples?

10. VAX C const variables as case labels: NOT constant expressions?

11. DECC uses SP to access local variables

12. Sounds like INS needs VMS ...