Non-optimal error message for unsupported character kind

Non-optimal error message for unsupported character kind


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

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.



8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Harald
yes - agree. This should be reported in a better way. I will submit file a case to improve the message.

For tracking purpose: Submitted as case DPD200236373

I will inform you here as soon as this gets implemented.

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.

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:

  IF (kind /= 0) THEN
    PRINT "('ISO_10646 characters supported.')"
    PRINT "('ISO_10646 characters not supported.')"


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.

Make it spit out a warning instead, then everyone is happy.

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 :-)


Leave a Comment

Please sign in to add a comment. Not a member? Join today