[Patch, fortran, 4.9] Use bool type instead gfc_try

Tobias Burnus burnus@net-b.de
Mon Apr 8 08:34:00 GMT 2013


Janne Blomqvist wrote:
> On Thu, Mar 21, 2013 at 11:31 PM, Janne Blomqvist
> <blomqvist.janne@gmail.com> wrote:
>> Updated patch which in addition does the above transformations as
>> well.
> .. and here is the actual patch (thanks Bernhard!)
http://gcc.gnu.org/ml/fortran/2013-03/msg00108.html

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;
to
   if (!gfc_resolve_expr(e) || !gfc_specification_expr(e))

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


Tobias



More information about the Fortran mailing list