- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I upgraded to 6.6B and I was pleasantly surprised how it caught few errors that were left unnoticed in 6.6A (misordered names in USE,ONLY lists and a few assumed-shape/assumed-array/scalar argument mismatches). However, apparently parsing of !DEC$IF parsing was changed as well. The following program:
Produces
D:UsersDujaCodeTestTest.f90(9) : Error: Unbalanced parentheses
STRING(isifrasab,9),2)
Not all syntax errors in a code that is supposedly not compiled will trigger such errors -- mostly, it is sensitive to some combinations with line continuations. Now, I recall Steve said once that !DEC$IF is not semantically identical to #ifdef...#endif. Should I file a bug report or is this as it should be? (But if it is, I can't figure out the rules?).
Jugoslav
!DEC$DEFINE _ENGLISH PROGRAM Test !DEC$IF DEFINED (_ENGLISH) WRITE(*,*) !DEC$ELSE CALL ErrHandler('a' // & STRING(isiftse(i),9)'b' STRING(isifrasab,9),2) !DEC$ENDIF END PROGRAM Test
Produces
D:UsersDujaCodeTestTest.f90(9) : Error: Unbalanced parentheses
STRING(isifrasab,9),2)
Not all syntax errors in a code that is supposedly not compiled will trigger such errors -- mostly, it is sensitive to some combinations with line continuations. Now, I recall Steve said once that !DEC$IF is not semantically identical to #ifdef...#endif. Should I file a bug report or is this as it should be? (But if it is, I can't figure out the rules?).
Jugoslav
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you think this should have done? The code in the ELSE clause looks very strange to me - definitely incorrect. I'm not sure what your complaint is.
!DEC$ IF is not like #ifdef in that !DEC$ IF operates on entire statements, not source lines.
Steve
!DEC$ IF is not like #ifdef in that !DEC$ IF operates on entire statements, not source lines.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see now. Forget it -- just a minor inconvenience. The actual code between ELSE...ENDIF where it popped out was never meant to be compiled at all (long story). My point was -- why should compiler even care about the contents of "commented" code. 6.6A acted as if !DEC$IF was line-based, not statement-based.
Jugoslav
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6.6A was still statement-based but text that would not be compiled was still run through syntax analysis. I think we have it in 6.6B that it won't complain about code it won't compile.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It appears to be complaining in this case. Seems to only care if there are too many ")". One would expect this code to be ignored.
James
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, I get it now... Sometimes I'm a bit slow to catch on...
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Should I file a bug report or I may consider it already done?
Jugoslav
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll take care of it - thanks.
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page