This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug fc107


On Apr 11, 2005, at 8:45 AM, Walt Brainerd wrote:

Passing (X) instead of X
has forever been a way to pass something "sorta by value",
rather than by reference.

And there is code that uses this, so it needs to work. Plus, it actually is specified to work by the standard. Not that the standard talks about "by value", with or without the "sorta", but the standard's semantics do pretty much match those of "by value".


SIZE((X)) is a perfectly legal initialization expression,
provided X is an array parameter, for example. The
parens don't make any difference here. (An initialization
expression in parens is also an initialization expression--
same for the others.)

A far more "interesting" test case than size((x)) is lbound((x)). Both lbound(x) and lbound((x)) are valid initialization expressions (if x is an array parameter), but their values will be different in general. Lbound((x)) is always 1, while lbound(x) is whatever it is (which might or might not be 1).


--
Richard Maine                |  Good judgment comes from experience;
Richard.Maine@nasa.gov       |  experience comes from bad judgment.
                            |        -- Mark Twain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]