Software Archive
Read-only legacy content
17061 Discussions

MODULE nesting and PRIVATE

Intel_C_Intel
Employee
431 Views
I had reported that my application that had given me 0 errors and 0 warnings
on CVF6.5 suddenly gave me over 250 errors when I used CVF6.6. I tried
CVF6.6.A with the same result.

I finally had time to track down why. I had to whittle the code down
significantly, but the pieces are still too large and I think the following
captures the issue.

MODULE A

USE B

PRIVATE

END MODULE A

---

MODULE B

INTEGER I

END MODULE B

---

SUBROUTINE C

USE A
USE B

INTEGER MyI = I

END SUBROUTINE C

---

The errors I was getting were occurring in every subprogram where I referenced
variables defined in MODULE B and where both MODULE A and B were USEd. It appears
that the variables in MODULE B derived their visibility from their USE in MODULE A
(where they were NOT declared PUBLIC) and NOT from the USE statement in
SUBROUTINE C.
All I had to do to get rid of all of the errors was to remove the "PRIVATE"
statement from what corresponds to the example MODULE A.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
431 Views
Your example (with the syntax errors corrected) works for me in CVF 6.6A. Please send an actual example that fails to vf-support@compaq.com and we'll take a look.

Steve
0 Kudos
Reply