This is the mail archive of the gcc-patches@gcc.gnu.org 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] PR16206 - array initializers


Steve,

My last comment. In the following section of code, do really
mean to fallthrough to AR_FULL in the switch? If yes, then
the convention is to add a comment as I've shown below. AFAICT, the patch is OK (with the fallthrough comment).


Yes, I do mean to fall through; that way, further references are processed.

+ case AR_SECTION:
+ if (find_array_section (p, p->ref) == FAILURE)
+ return FAILURE;
+ p->ref->u.ar.type = AR_FULL;
+ /* FALLTHROUGH. */


Will do, although I have always thought it to be a bit redundant.

case AR_FULL:
! if (p->ref->next != NULL
! && (p->ts.type == BT_CHARACTER || p->ts.type == BT_DERIVED))
{
! cons = p->value.constructor;
! for (; cons; cons = cons->next)
! {
! cons->expr->ref = copy_ref (p->ref->next);
! simplify_const_ref (cons->expr);
! }
}
! gfc_free_ref_list (p->ref);
! p->ref = NULL;
break


Thanks

Paul


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