replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Not Clear diagnostics
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 

Not Clear diagnostics
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Tue Jul 02, 2019 10:57 am    Post subject: Not Clear diagnostics Reply with quote

Usually spending hell of time to decipher where is my error due to such diagnostics. Would it be possible for compiler to tell exactly what's wrong - which variable is bad ? The one like below was acceptable when the cars were not self-driving Smile))

Code:
 i=winio@(' Angle, delta %30^sl %10`rf %30^sl %10`rf %ff&', &
 Slider_Angle,      0d0, 180.01d0, PrepDataForSlider_f_E, Angle_f_E,&
 Slider_AngleDelta, 0d0,  90.01d0, PrepDataForSlider_f_E, AngleDelta_f_E)

*** Error 1221: WINIO@ cannot process REAL(KIND=1) arguments, only CHARACTER,
    INTEGER(3), INTEGER(4) or REAL(2)

*** Error 1221: WINIO@ cannot process REAL(KIND=1) arguments, only CHARACTER,
    INTEGER(3), INTEGER(4) or REAL(2)
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Tue Jul 02, 2019 11:58 am    Post subject: Reply with quote

In similar situations, where it is not clear which variable has an improper type and causes the compiler to issue an error message but without the name of the variable that is responsible for the error, we can specify /xref and look at the types in the cross-reference listing.

I tried this code based on your report:
Code:
program drw
implicit none
integer i
real Angle_f_E  ! not suitable as argument to WINIO@
double precision Slider_Angle, PrepDataForSlider_f_E,AngleDelta_f_E, Slider_AngleDelta
!
i=winio@(' Angle, delta %30^sl %10`rf %30^sl %10`rf %ff&', &
   Slider_Angle,      0d0, 180.01d0, PrepDataForSlider_f_E, Angle_f_E,&
   Slider_AngleDelta, 0d0,  90.01d0, PrepDataForSlider_f_E, AngleDelta_f_E)
end program

The 8.51 compiler produced a zero-length file for the cross-reference list.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Tue Jul 02, 2019 5:38 pm    Post subject: Reply with quote

I am making so many typos and errors per day that usually avoid any xref or lis or any other additional files besides the standard output of diagnostics because afraid to break my head in these additional kilometer long files. The standard compilation output warning and comment output is also hell long but there it is possible to search for the pattern *** and this is the only i can afford doing 200 times per day Smile

BTW, in my case all variables were real*8. The final place for error was in not declaring
integer, external:: PrepDataForSlider_f_E.

Compiler kept mum about this and that caused me to lose an hour swearing on myself and a devilry Smile

Compiler diagnostics should be much more specific and more verbose in explaining errors. We are living in the times when computers with artificial intelligence overcome humans, why they can not find such easy for them errors for themselves?


Last edited by DanRRight on Wed Jul 03, 2019 4:10 am; edited 2 times in total
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Wed Jul 03, 2019 3:45 am    Post subject: Re: Reply with quote

John-Silver wrote:
Mecej4 ...

The 8.51 compiler ?

where did that materialise from ?


See Paul's post of Fri May 31, 2019, http://forums.silverfrost.com/viewtopic.php?t=3999 .
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Wed Jul 03, 2019 3:46 am    Post subject: Re: Reply with quote

Duplicate, please DELETE!

Last edited by mecej4 on Wed Jul 03, 2019 8:00 am; edited 1 time in total
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Wed Jul 03, 2019 4:27 am    Post subject: Re: Reply with quote

[quote="John-Silver"]
Quote:
Not a chance ! computers with artici��ficial intelligence are only as good as the human programming them ! (same goes for all programs actually Smile


We program into computer models so complex things that we can not find the solutions by ourselves. Computers can follow simultaneously 1000 things, we humans barely 1, 2 or 3. The most of human activity is usually just to choose one way which we think is optimal among several possible variants. Like one your guy ones said "Americans are always eventually doing things right way... after exhausting all other possibilities" Smile)) Not just Americans, obviously.

Computers can do optimization work much faster and take larger sample base. Generally we lose even to a fish or simple fly: the fly is smarter to escape than any human initially think, and it takes time before we really learn how to kill a fly (even then we lose in score win-lose ). Do you think 99% of people do way different things than simple ant is doing? Robots can substitute most of their activity in the life easily

Quantum mechanics theory for example was found by simple random try process to find the mathematical formulas which fit the experiment. We completely lost understanding of things at this moment, we can only find appropriate mathematics which fits the life. That what now is called "understanding". Robots will be able to do this even better. Not even mentioning again the solution of complex things we are barely capable of on very simplified models. That all means end of humans
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jul 03, 2019 9:12 am    Post subject: Reply with quote

In future these error messages for winio@ will take the form

Code:
error 140 - WINIO@ cannot process REAL(KIND=1) argument XMAX, only CHARACTER, INTEGER(3) or REAL(2)


for a REAL(1) variable XMAX.

For an invalid constant it will give the number of the argument.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Wed Jul 03, 2019 10:43 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
In future these error messages for winio@ will take the form
Code:
error 140 - WINIO@ cannot process REAL(KIND=1) argument XMAX, only CHARACTER, INTEGER(3) or REAL(2)
for a REAL(1) variable XMAX.
For an invalid constant it will give the number of the argument.

Nice addition. So now wrong variable will be called by name explicitly together with its position, like "argument #21 in continuation @143 ? That would be great. I think almost all winio@ code should be compiled with the switch /full_debug even if the entire fortran source is compiled /nodebug /nocheck /optimize because nobody cares how superfast windows are popping into face. Much more important that GUI will diagnose itself fully when problems occur. Clearwin is not a standard Fortran and people forget its rules easily, or even did not even know at all, and almost definitely do not understand how its magic works.

And also how about real source of this error in my code (missing function, or not declaring it as integer, external) if none of the real*8 violations would be found? Would it be possible to have diagnostics like "Declaration of the function PrepDataForSlider_f_E as integer, external is missing?"

One more suggestion - Error diagnostics should not mention Integer where there is no integers, and REAL, where is no specific reals. Also i still mix up in my head all the KINDs of this Fortran, KIND(1), KIND(3), KIND(7)... the naming scheme made by Standard is an absurd made to make Fortran to die slowly and painfully among engineering and even scientific crowd. May be a hint has to be made to name KINDs more bytes-specific. Computers are smart and can do that. People by great majority are stupid or at least for sure lazy and have great inertia.

For the FTN95, the best diagnostics compiler (but too laconic and cryptic on that) offering user friendly deep (a la "Level 3") diagnostics is just some minor cosmetic change. This is not of any priority of course, just the suggestion for the potential distant goal. I'd personally see the Polyhedron tests speedup first
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Thu Jul 04, 2019 4:00 pm    Post subject: Re: Reply with quote

DanRRight wrote:
...
One more suggestion - Error diagnostics should not mention Integer where there is no integers, and REAL, where is no specific reals.

If you did not put in IMPLICIT NONE, either as a statement or a compiler option, Fortran implicit type rules were in force. The argument PrepDataForSlider_f_E has the implicit type REAL, so the compiler is correct to mention "REAL" as the incorrect type for an argument that had to be integer -- indeed, the behaviour that we expect from the compiler.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Thu Jul 04, 2019 10:55 pm    Post subject: Reply with quote

In our specific case compiler was simply too lazy. In "...%30^sl..." compiler knows for sure what ^ means. It means here is expected not a variable but a function. Despite of that it did not check if something where it should be placed a function was declared as a function. Functions for winio always have to be declared, here no freedom is given like avoiding using implicit none.
And by the way for more general case the compiler also knows if "implicit none" was declared or not. If not it can give more precise diagnostics about expected reals and integers just by first letter. So, here we return to our forgotten sheep: don't use implicit none! 😁
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Fri Jul 05, 2019 3:53 am    Post subject: Re: Reply with quote

DanRRight wrote:
In our specific case compiler was simply too lazy. In "...%30^sl..." compiler knows for sure what ^ means.

We could also say "... too efficient".

Some checking is done at compile time, some other checking is done only at execution time, some things are never checked at all. The first argument to WINIO@ is similar to a format string in a READ or WRITE statement. Since such a string can be modified at execution time before being passed as an argument, in general such an argument cannot be checked at compile time except in a limited way. Take, for example,
Code:
integer i
...
i = 123
write(*,'(1xE12.3)')i
...

The compiler will tell you, at compile time, that the format is missing a comma, but not that the format E12.3 is inappropriate for an integer argument. If I add the missing comma, compile and run, the mismatch is detected only during execution.

The compiler behaves similarly when you use WINIO@. It appears to check only the types of the arguments at compile time ... string followed by any number of arguments of type integer, double precision, ... When the error involves passing an integer argument when the control string calls for a double precision variable, such an error is checked before execution of that WINIO@ call, not at compile time.

When the format/control string is constant and completely known at compile time, in principle the compiler could check each argument for conformity with its corresponding format/control specifier within the string. However, that would require that the checking code be duplicated in the compiler and the RTL, or that the checking code should be in one DLL that is used by both the compiler and the RTL.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Fri Jul 05, 2019 4:59 am    Post subject: Re: Reply with quote

mecej4 wrote:

When the format/control string is constant and completely known at compile time, in principle the compiler could check each argument for conformity with its corresponding format/control specifier within the string. However, that would require...


That is exactly what in 99.999% codes are happening, including my example above. The probability of making typo or error by the programmer is way larger than the probability to find super-picky programmer who will invent such format like above 1xE12.3 hell know what Smile . But the compiler tells "OK, i'm too stupid to catch these errors, and lazy too, but who cares, at run time we will see if program crash and that will find you error". Three hours after the run started... ;(

This was often an argument of users who preferred GUI builder Winteracter to Clearwin+. They did not like that CWP barely reported any errors at compile time and then when you try to run, it either crash or did not run as expected (right now CWP is better with this but still i'd prefer for it to check everything even undefined variables *at compile time* otherwise large GUI will be unstable and we will get some errors and crashes which will be hard to resolve). And this is also why no one uses Fortran for heart rate pacemakers. Imagine how after firmware update, the pacemaker will start running and in the typical manner of all Fortran programs will crash right in the chest of the patient Smile Because errors are found at run time. This is like a bike with no brakes which stops by hitting something. Crash is fortraneers' best debugger and all of them think this is normal.


Last edited by DanRRight on Sun Jul 07, 2019 3:07 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Jul 05, 2019 7:31 am    Post subject: Reply with quote

In case anyone has missed it, there is a relatively new FTN95 compiler option /CHECK_WINIO that does some checking of winio@ arguments which otherwise would not be checked until runtime. This will only be useful for simple winio@ calls. As mecej4 rightly points out, there are some things that can only be checked at runtime.

As for compilers (and by implication their authors) being lazy, personally I respond better to encouragement rather than to abuse, but we have been down that road before.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Fri Jul 05, 2019 8:48 am    Post subject: Reply with quote

Paul, "Lazy" relates to all Fortran compilers error reporting, with all other ones being much worse in finding errors, describing what the error is, and suggesting the cure. Perhaps this was done due to Fortran Standard Committee decisions to make this language operate like that.
I wrote many times here that diagnostics has to be more verbose and user friendly. Even for me who used Fortran for 40 years the language of diagnostics is often unacceptable laconic and worse than it could be. It often just gives the hint and leaves more on humans to find the error while in reality could tell exactly what the error is, or at least narrow the guessing job substantially. Probably i should be mentioning more that i already see in FTN95 the changes in the areas of wording in diagnostics messages and in what is diagnosed, so that this discussion would be understood as more general than specific to FTN95. I well understand that any diagnostics (and FTN95 finds several times more problems than other compilers) is way better than no diagnostics at all. Even just the pattern *** with no diagnostics message at all, or something in Chinese, is better than no diagnostics.
Here is how many common errors find other compilers for example

FTN95 49
PGI 15
Absoft 18
Gfortran 26
Intel 28

Can anyone imagine me with PGI compiler? Smile With it i'd be dancing every time my black cat meowed with the hint when i'm on the page with the bug i could not find

And i wrote that what is missing is way smaller than what's already done: would be good to add more user friendly layer of explanation of diagnostics (say, with suggestions what could be typically wrong) and to add more deeper scanning of source texts to make error reports less general and more specific. Both are just the additions to what's already exist, so no reason for taking this thread way too personal. My productivity due to larger and larger GUI and larger main source code slowly and steadily approaching zero. We've all heard of this trend as a function of size. This is because of too many options to suspect for the possible reason of the bug. Without more and more sophisticated and targeted computer diagnostics i soon will be unable to find any bugs.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1257
Location: Morrison, CO, USA

PostPosted: Fri Jul 05, 2019 2:42 pm    Post subject: Reply with quote

Paul,

Thanks for the reference to /CHECK_WINIO. I have been making many modifications to my code, and this has found a number of errors (typos, mostly), but also some other problems that my old eyes did not catch when typing.

It would appear that when a single error is detected using this option, the compiler immediately exits versus what I would have expected; namely to continue the compilation of the file to the end. I have /NO_QUIT turned on.

Bill
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8

 
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