This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] PR52864 - fix actual/formal checks
- From: Tobias Burnus <burnus at net-b dot de>
- To: Mikael Morin <mikael dot morin at sfr dot fr>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Wed, 25 Apr 2012 08:14:57 +0200
- Subject: Re: [Patch, Fortran] PR52864 - fix actual/formal checks
- References: <4F86F38C.8050702@net-b.de> <4F9702C9.2010109@sfr.fr>
Hello Mikael,
thanks for the review. Regarding:
Mikael Morin wrote:
is there a reason to guard the class_pointer condition with
attr.class_ok in the first conditional and with CLASS_DATA(...) !=
NULL in the two other ones? Not that it matters much, and in fact, I
think the patch as is is good enough for committal (yes, it is a OK).
I'm asking as I never know myself what is the correct, canonical way
to handle the class_* hell...
It's a good question what's more appropriate. My impression is that both
is nearly identical; I frankly don't know whether what's the exact
difference. I recall that I once had to use CLASS_DATA() != NULL to
avoid a segfault. I don't remember whether it was the issue below or
something different.
For an expression, CLASS_DATA () != NULL has the big advantage that one
avoids to walk the expression: For an expr, one needs to check
expr->symtree->n.sym but also the "ref" tree. Thus, CLASS_DATA is much
simpler than class_ok.
Looking at my patch, I have a dummy argument (i.e. gfc_symbol) - and for
those, one can simply access fsym->sym->attr.class_ok.
Tobias