[PATCH, Fortran] ABSTRACT INTERFACE
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Sun Aug 19 20:29:00 GMT 2007
Tobias Burnus wrote:
> 2007-08-18 Tobias Burnus <burnus@net-b.de>
>
> * gfortran.h: Add declaration for gfc_is_intrinsic_typename.
> * symbol.c: Add function gfc_is_intrinsic_typename.
> * parse.c (decode_statement): Check for space in ABSTRACT INTERFACE.
> (parse_interface): Use gfc_is_intrinsic_typename.
> * decl.c (gfc_match_derived_decl): Ditto.
>
> 2007-08-18 Tobias Burnus <burnus@net-b.de>
>
> * gfortran.dg/interface_abstract_2.f90: New.
> * gfortran.dg/interface_abstract_1.f90: Fix typo.
>
Coming to think of it, I agree with Uros' comment that the error should
be issued by the caller of gfc_is_intrinsic_typename.
Your ChangeLog entries are not in standard form:
> * gfortran.h: Add declaration for gfc_is_intrinsic_typename.
> * symbol.c: Add function gfc_is_intrinsic_typename.
Should be:
* gfortran.h (gfc_is_intrinsic_typename): Add declaration.
* symbol.c (gfc_is_intrinsic_typename): New function.
i.e. the function name should appear parenthesized after the filename.
> Tobias Schlüter wrote:
>>> >> + case INTERFACE_ABSTRACT:
>>> >> gfc_error ("Missing generic specification in USE statement at
>>> >> %C");
>> > Please add a test for this error. In general all error messages
>> > should be tested.
> I think this is impossible. gfc_match_interface has difficulties
> returning INTERFACE_NAMELESS as gfc_match_name() [essentially] either
> gives an error or matches an (existing or nonexisting) name. But
> INTERFACE_ABSTRACT is *never* returned. However, it is needed in
> module.c since if not all enum possibilities have a "case..:" in the
> switch() block, the compiler bails out with an error.
I'm not sure I follow. Shouldn't this be
case INTERFACE_ABSTRACT:
gcc_unreachable ();
or
default:
gcc_unreachable ();
then? It's certainly not right to simply run some codepath in cases
that can't happen.
Please consider a patch that addresses these issues as pre-approved. I
would do it myself, but my build is currently failing with weird
assembly errors on i686-darwin :-(
Cheers,
- Tobi
More information about the Fortran
mailing list