-qdescriptor

Category

Portability and migration

@PROCESS

None.

Purpose

Specifies the XL Fortran internal descriptor data structure format to use for non object-oriented entities in your compiled applications.

Syntax

Read syntax diagramSkip visual syntax diagram
                       .-v1-.   
>>- -q--descriptor--=--+-v2-+----------------------------------><

Defaults

Parameters

v1
Use an internal descriptor data structure format that provides compatibility with objects compiled with XL Fortran V10.1 and earlier.
v2
Use an internal descriptor data structure format that provides compatibility with new features available in XL Fortran V11.1 and above. This setting allows your programs to take advantage of new object-oriented features and constructs.

Usage

Regardless of what -qdescriptor setting is in effect, applications containing object-oriented constructs will use the v2 data structure format for those constructs, and will not be compatible with objects compiled with XL Fortran V10.1 or earlier. You should consider explicitly using the v2 setting if your applications do not need to interact with objects that were compiled with earlier versions of XL Fortran.

The choice of -qdescriptor setting is an important consideration when building libraries or modules for distribution. Users of these libraries and modules will need to be aware of the -qdescriptor setting and compile the code that uses them in a compatible way. It is suggested that such libraries and modules be built with the -qsaveopt option so that the objects themselves will encode the compilation options in a user-readable form.

If you are building modules with V11.1 or later that contain user-visible derived types, consider building them with the -qxlf2003=polymorphic suboption. This allows users of the module to use or extend the derived types in a Fortran object-oriented context that uses polymorphism.

In the Fortran 2003 object-oriented programming model, the XL Fortran compiler supports using types and type extensions from types defined in modules not compiled with -qxlf2003=polymorphic, as long as the types are not used in a context that requires polymorphism. This support extends to modules built with older XL Fortran compilers, as well. However, if the compiler detects the attempted use of a type or a type extension from a module not compiled with -qxlf2003=polymorphic in a context that requires polymorphism, an error message will be issued and compilation halted.

If a module built with the -qdescriptor=v1 setting or a module built with XL Fortran v10.1 or earlier is used in a compilation where -qdescriptor=v2 has been specified, the compiler will diagnose this mismatch and halt compilation after issuing an error message.

When using the -qdescriptor=v2 option, the compiler is unable to diagnose unsafe usage where objects built with the v2 setting are mixed with those built with the v1 setting or with XL Fortran 10.1 or older compilers. Even if your program appears to function properly, this usage is unsupported. The descriptor formats are different sizes and, when used with certain constructs, data layouts will change resulting in undefined and unsupported behavior. For example, the sizes of allocatable and pointer entities within derived types will be different resulting a differing size for the derived type itself.

Related information