Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Bug in Salford's FTN95 compiler version 5.20.1?
The following program yields the value of 1.00000 under debug win32
mode of FTN95 compiler version 5.20.1.
The correct value should be 2.00000
I do get the correct value when the 'OPTIONS(CHECK)' is commented out.

Can someone check it out?

yair

PRINT *,F2()
END
FUNCTION F1(X)
F1=X
END
OPTIONS(CHECK)
FUNCTION F2()
REAL X(1)/1./
F2=ABS(F1(X(1)))*2.
END

Report this thread to moderator Post Follow-up to this message
Old Post
yair
04-03-08 12:43 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?
On Apr 2, 3:35=A0pm, yair <yair...@gmail.com> wrote:
> The following program yields the value of 1.00000 under debug win32
> mode of FTN95 compiler version 5.20.1.
> The correct value should be 2.00000
> I do get the correct value when the 'OPTIONS(CHECK)' is commented out.
>
> Can someone check it out?
>
> yair
>
> =A0 =A0 =A0 PRINT *,F2()
> =A0 =A0 =A0 END
> =A0 =A0 =A0 FUNCTION F1(X)
> =A0 =A0 =A0 F1=3DX
> =A0 =A0 =A0 END
> =A0 =A0 =A0 OPTIONS(CHECK)
> =A0 =A0 =A0 FUNCTION F2()
> =A0 =A0 =A0 REAL X(1)/1./
> =A0 =A0 =A0 F2=3DABS(F1(X(1)))*2.
> =A0 =A0 =A0 END

I believe that your program relies on an extension to the standard.
With g95 I get:

C:\temp>type u.f
PRINT *,F2()
END
FUNCTION F1(X)
F1=3DX
END
!     OPTIONS(CHECK)
FUNCTION F2()
REAL X(1)/1./
F2=3DABS(F1(X(1)))*2.
END

C:\temp>g95 u.f
In file u.f:8

REAL X(1)/1./
1
Error: Syntax error in data declaration at (1)

C:\temp>type u1.f
PRINT *,F2()
END
FUNCTION F1(X)
F1=3DX
END
!     OPTIONS(CHECK)
FUNCTION F2()
REAL X(1)
DATA X(1)/1./
F2=3DABS(F1(X(1)))*2.
END

C:\temp>g95 u1.f

C:\temp>a
2.

C:\temp>

Report this thread to moderator Post Follow-up to this message
Old Post
e p chandler
04-03-08 12:43 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?
e p chandler wrote:

(snip)

> I believe that your program relies on an extension to the standard.
> With g95 I get:

(snip)

>       REAL X(1)/1./
>                1
> Error: Syntax error in data declaration at (1)

Yes, I believe the standard form is:

REAL X(1)
DATA X/1./

but it is hard to see how, assuming the non-standard for exists
and works correctly, it could give the wrong answer.

-- glen


Report this thread to moderator Post Follow-up to this message
Old Post
glen herrmannsfeldt
04-03-08 12:43 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?

"yair" <yair999@gmail.com> wrote in message
news:085249e2-4e47-4b6e-aaa7-b7b1d97bba3f@e10g2000prf.googlegroups.com...
> The following program yields the value of 1.00000 under debug win32
> mode of FTN95 compiler version 5.20.1.
> The correct value should be 2.00000
> I do get the correct value when the 'OPTIONS(CHECK)' is commented out.
>
> Can someone check it out?
>
> yair
>
>      PRINT *,F2()
>      END
>      FUNCTION F1(X)
>      F1=X
>      END
>      OPTIONS(CHECK)
>      FUNCTION F2()
>      REAL X(1)/1./
>      F2=ABS(F1(X(1)))*2.
>      END
>
[FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007]
NO ERRORS  [<BUG1> FTN95/Win32 v5.10.0]
NO ERRORS  [<F1> FTN95/Win32 v5.10.0]
0007)       OPTIONS(CHECK)
*** Switching CHECK mode on with OPTIONS in the middle of a file requires
the
file to be compiled with /DEBUG

1 ERROR [bug1.F95] - Compilation failed.

--

"That this social order with its pauperism, famines, prisons, gallows,
armies, and wars is necessary to society; that still greater disaster
would ensue if this organization were destroyed; all this is said only
by those who profit by this organization, while those who suffer from it
- and they are ten times as numerous - think and say quite the contrary."

~~  Leo Tolstoy



Report this thread to moderator Post Follow-up to this message
Old Post
Gerry Ford
04-03-08 03:56 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?

"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message
news:JZ-dnavzub9CYG7anZ2dnUVZ_tjinZ2d@comcast.com...
>e p chandler wrote:
>
> (snip)
> 
>
> (snip)
> 
>
> Yes, I believe the standard form is:
>
>       REAL X(1)
>       DATA X/1./
>
> but it is hard to see how, assuming the non-standard for exists
> and works correctly, it could give the wrong answer.

Silverfrost made it relatively painless to figure this out in Japanese time.
I always say about open source disros that they have to have dos shortcut to
whereever you're to write source.  It was just waiting for me when I pulled
up the start menu.

program bug1
PRINT *,F2()
END
FUNCTION F1(X)
F1=X
END
OPTIONS(CHECK)
FUNCTION F2()
REAL X(1)
data x/1./
F2=ABS(F1(X(1)))*2.
END program bug1
! ftn95 bug2.f95 >text43.txt


[FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007]
NO ERRORS  [<BUG1> FTN95/Win32 v5.10.0]
NO ERRORS  [<F1> FTN95/Win32 v5.10.0]
0007)       OPTIONS(CHECK)
*** Switching CHECK mode on with OPTIONS in the middle of a file requires
the
file to be compiled with /DEBUG

1 ERROR [bug2.F95] - Compilation failed.

I think that the thing the compiler is shouting with 3 asterisks both times
is relevant.


--

"That this social order with its pauperism, famines, prisons, gallows,
armies, and wars is necessary to society; that still greater disaster
would ensue if this organization were destroyed; all this is said only
by those who profit by this organization, while those who suffer from it
- and they are ten times as numerous - think and say quite the contrary."

~~  Leo Tolstoy



Report this thread to moderator Post Follow-up to this message
Old Post
Gerry Ford
04-03-08 03:56 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?
> I believe that your program relies on an extension to the standard.
> With g95 I get:
>
> C:\temp>type u.f
> =A0 =A0 =A0 PRINT *,F2()
> =A0 =A0 =A0 END
> =A0 =A0 =A0 FUNCTION F1(X)
> =A0 =A0 =A0 F1=3DX
> =A0 =A0 =A0 END
> ! =A0 =A0 OPTIONS(CHECK)
> =A0 =A0 =A0 FUNCTION F2()
> =A0 =A0 =A0 REAL X(1)/1./
> =A0 =A0 =A0 F2=3DABS(F1(X(1)))*2.
> =A0 =A0 =A0 END
>
> C:\temp>g95 u.f
> In file u.f:8
>
> =A0 =A0 =A0 REAL X(1)/1./
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01
> Error: Syntax error in data declaration at (1)
>
> C:\temp>type u1.f
> =A0 =A0 =A0 PRINT *,F2()
> =A0 =A0 =A0 END
> =A0 =A0 =A0 FUNCTION F1(X)
> =A0 =A0 =A0 F1=3DX
> =A0 =A0 =A0 END
> ! =A0 =A0 OPTIONS(CHECK)
> =A0 =A0 =A0 FUNCTION F2()
> =A0 =A0 =A0 REAL X(1)
> =A0 =A0 =A0 DATA X(1)/1./
> =A0 =A0 =A0 F2=3DABS(F1(X(1)))*2.
> =A0 =A0 =A0 END
>
> C:\temp>g95 u1.f
>
> C:\temp>a
> =A02.
>
> C:\temp>- Hide quoted text -
>
> - Show quoted text -

That change did NOT change the situation. I still get 1.00000.


Report this thread to moderator Post Follow-up to this message
Old Post
yair
04-03-08 11:27 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?
On Apr 3, 12:48=A0am, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> e p chandler wrote:
>
> (snip)
> 
>
> (snip)
> 
>
> Yes, I believe the standard form is:
>
> =A0 =A0 =A0 =A0REAL X(1)
> =A0 =A0 =A0 =A0DATA X/1./
>
> but it is hard to see how, assuming the non-standard for exists
> and works correctly, it could give the wrong answer.
>
> -- glen

Indeed, the changed standard form still gives the wrong answer of
1.00000.

Report this thread to moderator Post Follow-up to this message
Old Post
yair
04-03-08 11:27 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?
On Apr 3, 6:31=A0am, "Gerry Ford" <ge...@nowhere.ford> wrote:
> [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007]
> =A0 =A0 NO ERRORS =A0[<BUG1> FTN95/Win32 v5.10.0]
> =A0 =A0 NO ERRORS =A0[<F1> FTN95/Win32 v5.10.0]
> 0007) =A0 =A0 =A0 OPTIONS(CHECK)
> *** Switching CHECK mode on with OPTIONS in the middle of a file requires
> the
> =A0 =A0 file to be compiled with /DEBUG
>
> =A0 =A0 1 ERROR [bug1.F95] - Compilation failed.

I forgot to mention, I DID run it in DEBUG mode under PLATO 4.0.

Report this thread to moderator Post Follow-up to this message
Old Post
yair
04-03-08 11:27 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?
On Apr 3, 6:47=A0am, "Gerry Ford" <ge...@nowhere.ford> wrote:
> "glen herrmannsfeldt" <g...@ugcs.caltech.edu> wrote in message
> .
> .
> .
> ! ftn95 bug2.f95 >text43.txt
>
> [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007]
> =A0 =A0 NO ERRORS =A0[<BUG1> FTN95/Win32 v5.10.0]
> =A0 =A0 NO ERRORS =A0[<F1> FTN95/Win32 v5.10.0]
> 0007) =A0 =A0 =A0 OPTIONS(CHECK)
> *** Switching CHECK mode on with OPTIONS in the middle of a file requires
> the
> =A0 =A0 file to be compiled with /DEBUG
>
> =A0 =A0 1 ERROR [bug2.F95] - Compilation failed.
>
> I think that the thing the compiler is shouting with 3 asterisks both time=[/color
]
s
> is relevant.

I DID compile and run it in DEBUG mode under PLATO 4.0.

Report this thread to moderator Post Follow-up to this message
Old Post
yair
04-03-08 11:27 AM


Re: Bug in Salford's FTN95 compiler version 5.20.1?

"yair" <yair999@gmail.com> wrote in message
news:17e3eadd-c021-4003-a11d-5fd55e2c0c19@b1g2000hsg.googlegroups.com...
On Apr 3, 6:47 am, "Gerry Ford" <ge...@nowhere.ford> wrote:
> "glen herrmannsfeldt" <g...@ugcs.caltech.edu> wrote in message
> .
> .
> .
> ! ftn95 bug2.f95 >text43.txt
>
> [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007]
> NO ERRORS [<BUG1> FTN95/Win32 v5.10.0]
> NO ERRORS [<F1> FTN95/Win32 v5.10.0]
> 0007) OPTIONS(CHECK)
> *** Switching CHECK mode on with OPTIONS in the middle of a file requires
> the
> file to be compiled with /DEBUG
>
> 1 ERROR [bug2.F95] - Compilation failed.
>
> I think that the thing the compiler is shouting with 3 asterisks both
> times
> is relevant.

I DID compile and run it in DEBUG mode under PLATO 4.0.

--->

How do you do that?

Check.

Debugging on the rio grande.  Cockroaches are terrorists.

--

"That this social order with its pauperism, famines, prisons, gallows,
armies, and wars is necessary to society; that still greater disaster
would ensue if this organization were destroyed; all this is said only
by those who profit by this organization, while those who suffer from it
- and they are ten times as numerous - think and say quite the contrary."

~~  Leo Tolstoy



Report this thread to moderator Post Follow-up to this message
Old Post
Gerry Ford
04-03-08 11:27 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 02:23 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.