This is the mail archive of the mailing list for the GCC 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, 4.9] Use bool type instead gfc_try

Janne Blomqvist wrote:
On Thu, Mar 21, 2013 at 11:31 PM, Janne Blomqvist
<> wrote:
Updated patch which in addition does the above transformations as
.. and here is the actual patch (thanks Bernhard!)

Thanks for the update and sorry for the delay. The patch idea as such is okay. However, the patch isn't.

+ if (!gfc_notify_std(GFC_STD_F2003, "Noninteger ""exponent in an initialization ""expression at %L", &op2->where))

Missing " " before the "(" additionally, the line is way too long. That's actually an issue throughout the whole file.

Additionally, the reformating caused code like: "Noninteger ""exponent in .... The "" is quite ugly.

If you fix those issues, and update the patch for the newly added code (which presumably added a few FAILUREs), the patch is okay.

It is, indeed, most of the time helpful as it shortens the code without loosing its clearness. (Only at a few places, 'I found FAILURE/SUCCESS a tad clearer.)

Thanks for the patch.

For nicer looking code, you could also do:

* Remove the trailing " " for
+           return false;
(That's the only modified line with a trailing space)

* Change
+  if (!gfc_resolve_expr(e)
+      || !gfc_specification_expr(e))
+    return false;
  if (!gfc_resolve_expr(e) || !gfc_specification_expr(e))

* Ditto for:
+         if (t
              && b->expr1 != NULL
and a few more.


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