This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, Fortran] PR35203 - reject dummies with VALUE + OPTIONAL
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Wed, 26 Mar 2008 21:43:30 +0100
- Subject: Re: [Patch, Fortran] PR35203 - reject dummies with VALUE + OPTIONAL
- References: <20080326203912.GA7862@physik.fu-berlin.de>
Tobias Burnus wrote:
Having a dummy which has VALUE and OPTIONAL attribute does not work in
gfortran, but is valid Fortran 9x/200x; to be more precise: One cannot
distinguish an absent argument (argument == NULL) from an argument
of value 0 (argument == 0). Without VALUE this is easy: arg == NULL
vs. *arg == 0.
One has therefore to do the same as for character variables: A hidden
argument needs to be passed.
This patch takes the simple route by simply rejecting such dummies.
OK for the trunk?
Please don't use gfc_error for shortcomings in the compiler. ICEing or
gfc_internal_error is much more appropriate for something where the
compiler is at fault.