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: [Patch, Fortran, OOP] PR 49638: [OOP] length parameter is ignored when overriding type bound character functions with constant length.


On 08/19/2011 01:55 PM, Mikael Morin wrote:
OK from my side for the code proper.

I have one comment though about this:
+/* Compare two expressions.  Return values:
+   * +1 if e1>  e2
+   * 0 if e1 == e2
+   * -1 if e1<  e2
+   * -2 if the relationship could not be determined
+   * -3 if e1 /= e2, but we cannot tell which one is larger.  */

I think this is misleading, as the function does not always return -3 when
e1/=e2. There is for example (currently) no special handling for operators.
Here is an attempt at expressing it:
   * -3 in some cases where we could determine that e1 and e2 have different
data dependencies (and thus are not guaranteed to have always the same value),
but we cannot tell whether one is greater than the other.

Besides that issue, I am wondering whether we shouldn't start to use an ENUM for those. I think for "<" vs. "==" vs. ">" one can use a number (-1, 0, 1) and then compare the result against 0 (>0, == 0 etc.).


However, for 5 values, I think it makes sense to do something else otherwise, someone write "... < 0" which not only matches -1 but also -2 or -3.

I think this does not block the committal but one should think about whether one should do it as follow up.

Tobias,
who has not read the patch.


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