This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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] PR 85088: improve diagnostic for bad INTENT declaration


Hi Janus,

I like what the patch does. However, I have one concern.

     * decl.c (match_attr_spec): Synchronize the DECL_* enum values with the
     INTENT_* values from the enum 'sym_intent'.

This part

+  { GFC_DECL_BEGIN = 0, DECL_ALLOCATABLE = GFC_DECL_BEGIN,
+    DECL_IN = INTENT_IN, DECL_OUT = INTENT_OUT, DECL_INOUT = INTENT_INOUT,
+    DECL_DIMENSION, DECL_EXTERNAL,
+    DECL_INTRINSIC, DECL_OPTIONAL,

brings a dependency of the values of sym_intent into this enum.

I know that the order of sym_intent is not likely to change, but I would
still prefer if you could add a comment to the sym_intent definition in
gfortran.h noting that INTENT_IN cannot be zero, and add a

gcc_assert (INTENT_IN > 0);

somewhere (which will be optimized away) with an explanatory comment.

OK with that change.

Thanks for the patch!

	Thomas


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