- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code compiles in fixed form, but has issues when treated as free form:
integer, parameter :: ck = kind ("a") ! default character kind
print *, ck
print *, ck_"a" ! valid
print *, ck _"a" ! invalid, ICE
print *, ck_ "a" ! invalid, not detected
print *, 1_"a" ! valid
print *, 1 _"a" ! invalid, ICE
print *, 1_ "a" ! invalid, not detected
end
% ifort ifort_bad_char_literal.f90 -fixed
--> OK.
% ifort ifort_bad_char_literal.f90
ifort_bad_char_literal.f90(4): error #5192: Lead underscore not allowed
print *, ck _"a" ! invalid, ICE
-------------------^
ifort_bad_char_literal.f90(4): error #5082: Syntax error, found CHAR_NAM_KIND_PARAM '' when expecting one of: :: ) ( , : * <END-OF-STATEMENT> ; . % (/ + - [ ] /) . ** / // ...
print *, ck _"a" ! invalid, ICE
------------------^
ifort_bad_char_literal.f90(7): error #5192: Lead underscore not allowed
print *, 1 _"a" ! invalid, ICE
------------------^
ifort_bad_char_literal.f90(7): error #5082: Syntax error, found CHAR_NAM_KIND_PARAM '' when expecting one of: :: ) , : * <END-OF-STATEMENT> ; . (/ + - ] /) ' ** / // > PRIVATE ...
print *, 1 _"a" ! invalid, ICE
-----------------^
ifort_bad_char_literal.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
compilation aborted for ifort_bad_char_literal.f90 (code 1)
So I think there is accepted-invalid code, and there is an ICE-on-invalid, as indicated.
Thanks,
Harald
Link Copied
0 Replies
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