forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

error messaging
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
offthechart



Joined: 04 Dec 2013
Posts: 17

PostPosted: Thu Jun 18, 2020 8:23 pm    Post subject: error messaging Reply with quote

Simple request. I currently compile with ftn95 filename.f

The errors do not include line numbers of the infraction. Since some of the error messages are rather 'obtuse' is there a way of getting the offending line number printed? Thanks.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Jun 19, 2020 7:58 am    Post subject: Reply with quote

If you run FTN95 from a command line then the line and its number are printed.

If you are compiling from Plato or Visual Studio then the errors are displayed in the "Output" window. If you can't see this window then go to the View menu and select view Output.
Back to top
View user's profile Send private message AIM Address
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Fri Jun 19, 2020 8:06 am    Post subject: Reply with quote

I am puzzled by your not seeing line numbers. The format used for displaying syntax errors (and the program listing, if requested) may be modified by the compiler options that are in effect (those specified at the command line, those in FTN95.CFG and directives in the source file).

Here is an example of compiling from the command line. I have a program in which line-113 contains ".0" added to the end of a WHILE (cond) DO statement:

Code:
      WHILE(ctrl.LT.0)DO.0


The compiler gives the following error message:

Code:
0113)       WHILE(ctrl.LT.0)DO.0
*** Invalid characters after DO statement
    1 ERROR  [<DOUBLE> FTN95 v8.62.1]
*** Compilation failed


As you can see, the message contains the line number, followed by the body of the offending line(s) of code, the text of the error message, and the name of the program unit ("double").

If I use the /Brief option on the same code, I see the following:

Code:
ERROR S:\LANG\FTN95\cbk.F 113:  Invalid characters after DO statement
    1 ERROR  [<DOUBLE> FTN95 v8.62.1]


which is in a more compact format, and displays the name of the source file as well.

Please provide an example of an error message without a line number if you still see one, and provide information on the compiler version and options that you used.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Fri Jun 19, 2020 2:46 pm    Post subject: Reply with quote

curiously, the example you give is both 'Brief' and 'More Complete' at the same time !
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "


Last edited by John-Silver on Fri Jun 19, 2020 8:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Fri Jun 19, 2020 3:27 pm    Post subject: Reply with quote

You eyes are sharp: fewer words but more informative!
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Fri Jun 19, 2020 8:57 pm    Post subject: Reply with quote

Indeed. Providing one's happy to look in another file for the actual line !

Pondering on this, what we need with compilers in general is an option to output Error information in TABULAR format and into a file
e.g.
'Error No.' 'LineEcho' 'Error Message' etc

That file could then be input into Excel for example and when there are a whole raft of errors couls be sorted in order to group all errors of same type for example, etc ...;

hich could be very useful indeed.

It would go a long way to satisfying Dan who made a comment yonks ago about the time needed to scan through the output and end up repeatedly missing some error.
We've all been there.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
offthechart



Joined: 04 Dec 2013
Posts: 17

PostPosted: Sat Jun 20, 2020 10:09 pm    Post subject: error message Reply with quote

OK. I intentionally created this error:

write(6,"(' Enter the 1" aluminum disk radius (in): ',$)")
The xtra " is an error. Here is what I got:

***"Unterminated character constant"
1 error [main program FTN95/Win32 v7.00.01]
***compilation failed

No line number given at all. This is what I meant by 'obtuse'. Thanks
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Sun Jun 21, 2020 3:07 am    Post subject: Reply with quote

The source line with the error, prefixed with the line number, is printed just preceding the text of the error message.

For the source file

Code:
write(6,"(' Enter the 1" aluminum disk radius (in): ',$)")
end


the compiler reports:

Code:
S:\LANG\FTN95\Bugs>ftn95 xtra.f90
[FTN95/Win32 Ver. 8.62.1 Copyright (c) Silverfrost Ltd 1993-2020]
0001) write(6,"(' Enter the 1" aluminum disk radius (in): ',$)")
*** Unterminated character constant
0002) end
COMMENT - The main program starting on this line does not have any executable statements
    1 ERROR, 1 COMMENT  [<main program> FTN95 v8.62.1]
*** Compilation failed


You can see the line number 0001) displayed on the line preceding the error message line containing '***'.
Back to top
View user's profile Send private message
offthechart



Joined: 04 Dec 2013
Posts: 17

PostPosted: Sun Jun 21, 2020 3:18 pm    Post subject: Reply with quote

I don't have version 8.6. I have version 7.0. Maybe that is the difference, but line numbers do no appear anywhere in the compile error, unlike what you just showed. Thanks but my command line has none of your example.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Sun Jun 21, 2020 3:49 pm    Post subject: Reply with quote

Other than the version number in the copyright line, I get the same output from versions 6.35 and 7.2.

It may help if you describe what steps you take -- with details of opening a command window, setting the environment for FTN95, and compiling the test source; the contents of FTN95.cfg in the FTN95 base directory. Or, if you are using Plato, Visual Studio or another IDE, information regarding that.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Sun Jun 21, 2020 4:12 pm    Post subject: Reply with quote

I found Version 7.0 on an older PC. Here is what it said for the same two-line program as above:

Code:
S:\LANG\FTN95\Bugs>ftn95 xtra.f90
[FTN95/Win32 Ver. 7.00.0 Copyright (c) Silverfrost Ltd 1993-2013]
0001) write(6,"(' Enter the 1" aluminum disk radius (in): ',$)")
*** Unterminated character constant
0002) end
COMMENT - The main program starting on this line does not have any executable statements
    1 ERROR, 1 COMMENT  [<main program> FTN95/Win32 v7.00.0]
*** Compilation failed


A compiler that did not associate source line numbers with error messages would be nearly useless; if FTN95 ever had that deficiency, we would certainly have heard from a number of users about that by now.
Back to top
View user's profile Send private message
offthechart



Joined: 04 Dec 2013
Posts: 17

PostPosted: Sun Jun 21, 2020 7:34 pm    Post subject: Reply with quote

Yes, mecej4 I have been successfully compiling and running many programs on version 7.00 for years. I use ftn95 and slink on the command line . I do not recall setting any environment. When I open the command screen it states,

"Setting environment for FTN95 for Microsoft.net and win32".

Then I get the prompt C:\...\..\ etc. > and off I go to FTN95 filename.f

I am running Windows 7 with 64 bit machine.

You are right without line numbers it is silly.
Back to top
View user's profile Send private message
offthechart



Joined: 04 Dec 2013
Posts: 17

PostPosted: Sun Jun 21, 2020 10:08 pm    Post subject: Reply with quote

Well I found that by typing ftn95 filename.f/brief on the command line, the compiler listed the line number before describing the 'unterminated character constant" error. Hopefully this is a solution. Thanks to all for responding. Smile
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Mon Jun 22, 2020 10:29 am    Post subject: Reply with quote

offthechart,

Could you please provide your complete cut down code example in a [code box], together with a trace of the compile option, say as:
ftn95 offthechart.f (your options) /echo > offthechart.log

I would like to understand what options are supressing the line number from being identified.

John Campbell
[/code]
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Mon Jun 22, 2020 10:59 am    Post subject: Reply with quote

As John C. wrote, it would be interesting to see the code, and putting it in a code-box is better than inline.

However, sometimes odd compiler behaviour is caused by the presence in the source code of stray tabs, form feeds, carriage returns, backspaces and other invisible characters. For such cases, a link should be provided for obtaining a true byte-for-byte copy of the original file.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group