This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug fortran/32732] [Bind C] Character scalars are passed as arrays
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: "Christopher D. Rickett" <crickett at lanl dot gov>
- Cc: FX Coudert <fxcoudert at gmail dot com>, Steve Ellcey <sje at cup dot hp dot com>, Tobias Burnus <burnus at net-b dot de>, Fortran List <fortran at gcc dot gnu dot org>, GCC-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 3 Aug 2007 14:18:25 -0700
- Subject: Re: [Bug fortran/32732] [Bind C] Character scalars are passed as arrays
- References: <200708031554.IAA04995@hpsje.cup.hp.com> <Pine.LNX.4.64.0708031053170.14774@lennox.lanl.gov> <Pine.LNX.4.64.0708031352400.14774@lennox.lanl.gov> <4DCE4416-D043-412B-B6C2-1AB8F208649C@gmail.com> <Pine.LNX.4.64.0708031507270.14774@lennox.lanl.gov>
On Fri, Aug 03, 2007 at 03:15:25PM -0600, Christopher D. Rickett wrote:
>
> the problem this patch addresses is the way character args are passed
> by-value to a bind(c) procedure. in non-bind(c), character scalars of any
> length are passed as an array type, which means an address. this doesn't
> work for bind(c) procedures with a character dummy (of len 1) if it's
> called by a C routine. C will promote char to an integer type node for
> passing it as a parameter. therefore, bind(c) procedures needed to change
> both the expected type of any by-value character dummies, and the type of
> the expression for the actual. i realize that i forgot to put a comment
> block at the top of gfc_conv_scalar_char_value; that should be done as i'm
> sure this issue will resurface.
>
> does that help? also, i think Steve Kargl was willing/planning to review
> the patch, so you may need to check with him.
>
I've been following the iterations between you and Steve E., I'm
somewhat familiar with the testing that's been done. I can deal
with this patch sometime tomorrow, so if FX beats me to a review
and commit I won't be upset.
--
Steve