This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, fortran, 4.9] Use bool type instead gfc_try
- From: Tobias Burnus <burnus at net-b dot de>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 08 Apr 2013 10:34:00 +0200
- Subject: Re: [Patch, fortran, 4.9] Use bool type instead gfc_try
- References: <CAO9iq9F0rhbqe-LMB1d=0pNyKraPK_KVKc2Tg1j2EP8Zu+EUgA at mail dot gmail dot com> <5148A0A0 dot 8010209 at net-b dot de> <CAO9iq9HSHxv3OLPGDpn9GV=aq5PDfBSSYttW6Y7C_GFrBLi=Qg at mail dot gmail dot com> <CAO9iq9FTg_C+pC8YA9C=KZ30-vQUjmkBoZezqHp4wmwZryAwaQ at mail dot gmail dot com> <CAO9iq9HE8ZrcSd90nKzTcsK+JJ2RYnJoO6ge4OdM++97RpVLxA at mail dot gmail dot com>
Janne Blomqvist wrote:
On Thu, Mar 21, 2013 at 11:31 PM, Janne Blomqvist
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
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)
+ 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.