This is the mail archive of the gcc-bugs@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]

[Bug fortran/62270] New: -Wlogical-not-parentheses warnings


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62270

            Bug ID: 62270
           Summary: -Wlogical-not-parentheses warnings
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org

-Wlogical-not-parentheses detected these two issues:

interface.c:compare_parameter
2013   /* F2008, 12.5.2.5; IR F08/0073.  */
2014   if (formal->ts.type == BT_CLASS && formal->attr.class_ok
2015       && actual->expr_type != EXPR_NULL
2016       && ((CLASS_DATA (formal)->attr.class_pointer
2017            && !formal->attr.intent == INTENT_IN)

trans-expr.c:gfc_conv_procedure_call
4445                   if (fsym->attr.optional
4446                       && e->expr_type == EXPR_VARIABLE
4447                       && (!e->ref
4448                           || (e->ref->type == REF_ARRAY
4449                               && !e->ref->u.ar.type != AR_FULL))

But my attempts to fix these failed.
The first one should likely be "&& formal->attr.intent != INTENT_IN)", but that
regressed gfortran.dg/pointer_intent_7.f90 test.  If I change it to "==", many
tests fail.
For the second one, perhaps just the "!" should be dropped, but I'm not sure
about that, testsuite didn't reveal anything.

Currently this PR is the last thing that is blocking the inclusion of
-Wlogical-not-parentheses in -Wall - I'd appreciate if anyone could look into
this PR.


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