Compiler option for Type structure

Compiler option for Type structure

Using CVF6.6B

My question is about the sequence of compiling Type declarations

The following example module has two types, where the second type is depending on the first one.

module global1
TYPE ITEM
REAL COST
CHARACTER(LEN=30) SUPPLIER
CHARACTER(LEN=20) ITEM_NAME
END TYPE ITEM

TYPE PRODUCE
REAL MARKUP
TYPE(ITEM) FRUIT
END TYPE PRODUCE
end module global1

This compiles fine

Now when I change the sequence of the types in the following way

module global2
TYPE PRODUCE
REAL MARKUP
TYPE(ITEM) FRUIT
END TYPE PRODUCE

TYPE ITEM
REAL COST
CHARACTER(LEN=30) SUPPLIER
CHARACTER(LEN=20) ITEM_NAME
END TYPE ITEM
end module global2

then I get the following error message

Error: This derived type name has not been declared. [ITEM]
TYPE(ITEM) FRUIT
-----------^

This is because the Type ITEM is compiled after it is needed for the Type Produce

Is the a possibility (compiler option) to compile the second module without changing the sequence ???

The problem is, I have a source code with lots of Type declarations and they are all in the wrong order.

Thanks for any help

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

No such option - you'll have to correct the code.

Steve

Retired 12/31/2016

Leave a Comment

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