Hello,
Concerning your (Jing Guo's) other (first?) message, you are right, there is
somewhat of an excess code in my example, and your example shows all that is
essential, but these are all just tests for me to see what exactly the
compiler is doing without looking at assembler code (since I don't know how
to do that on IA32 architectures anyway :).
And, I can not hold a couple of years, unfortunately, so I am ready to resort
to messes such as mixed Cray/Fortran pointers in certain critical situations
:(
As to this second message:
> A desirable compiler should produce this result:
> [snip]
> B:
> -->Passing (1:2):
> 1., 3., 0.E+0
Yes!
0 for the third element is of course desirable, but not necessary. According
to the standard, this element is undefined, but the reference a(3) inside
print_a will just step over the bound of a and print the third element of the
array temporary, which may be whatever or even cause a crash.
But as you can see, the second compiler (whose name I cannot reveal...)
printed 1 2 3 even for B, which is wrong! I will submit a bug report
tomorrow...
Thanks,
Aleksandar
--
__________________________________
Aleksandar Donev
Complex Materials Theory Group (http://cherrypit.princeton.edu/)
Princeton Materials Institute & Program in Applied and Computational
Mathematics
@ Princeton University
Address:
419 Bowen Hall, 70 Prospect Avenue
Princeton University
Princeton, NJ 08540-5211
E-mail: [log in to unmask]
WWW: http://atom.princeton.edu/donev
Phone: (609) 258-2775
Fax: (609) 258-6878
__________________________________
|