- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the compiler's error message could by more helpful for the following example:
integer, parameter :: iso = SELECTED_CHAR_KIND ("ISO_10646") ! unsupported
character(kind=iso) , parameter :: c = CHAR (32,KIND=iso)
print *, 'selected_char_kind ("ISO_10646") =', iso
end
ifort 13.0 produces:
ifort_character_kinds.f90(2): error #6684: This is an incorrect value for a kind type parameter in this context. [ISO]
character(kind=iso) , parameter :: c = CHAR (32,KIND=iso)
-----------------^
ifort_character_kinds.f90(2): error #6684: This is an incorrect value for a kind type parameter in this context.
character(kind=iso) , parameter :: c = CHAR (32,KIND=iso)
-------------------------------------------------------^
compilation aborted for ifort_character_kinds.f90 (code 1)
Commenting out the offending line 2 and running the program shows that
the encoding is not supported and thus iso==-1. It would be helpful if the error message
would quote the actual invalid value.
Regards,
Harald
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Compiler 14.0 now correctly displays an error message about the unsupported ISO character type:
iso_char.f90(1): error #6104: ISO_10646 character type is not yet supported. ['ISO_10646']
I'm closing this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler shouldn't be issuing an error for the SELECTED_CHAR_KIND intrinsic - its behaviour in the face of an unsupported kind is well defined by the standard - it needs to return -1. An error prevents the compiler from being able to execute a conforming program, such as:
[fortran] INTEGER, PARAMETER :: kind = SELECTED_CHAR_KIND ("ISO_10646")
IF (kind /= 0) THEN
PRINT "('ISO_10646 characters supported.')"
ELSE
PRINT "('ISO_10646 characters not supported.')"
END IF
END[/fortran]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ian
thanks for the feedback. I will forward to engineering. Our documentation is not clear here either: While it excludes ISO_10646 as input:
(Input) Must be scalar and of type default character. Its value must be 'DEFAULT' or 'ASCII'
it defines the return value as you describe:
The result value is 1 if NAME has the value 'DEFAULT' or 'ASCII'; otherwise, the result value is -1
I agree - we should allow the input and return -1 until it is implemented.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make it spit out a warning instead, then everyone is happy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ian
I talked to engineering: There are a few additional issues related to this intrinsics. We will fix them now. I filed a new case DPD200248361 to keep track of this and will add an update here as soon as it got corrected. I requested too to convert the error message to a WARNING
BTW: In your sample code the comparison should be ( == 1) of ( /= -1) but it is clear what you mean :-)
Heinz

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