[Bug fortran/32732] [Bind C] Character scalars are passed as arrays

Steve Ellcey sje@cup.hp.com
Thu Aug 2 20:34:00 GMT 2007


So I did some investigating into why this patch didn't fix value_6.f03.
It looks like the problem is with the call from main to test.  Main is
still passing 'a' as an array of char instead of just a char.

It looks like gfc_conv_function_call is not calling
gfc_conv_scalar_char_value at the call to test in this test case.
Looking at the if statement protecting that call, I see:

                  if (fsym->ts.type == BT_CHARACTER             /* TRUE */
                      && fsym->backend_decl != NULL             /* FALSE */
                      && fsym->ts.is_c_interop                  /* TRUE */
                      && fsym->ns->proc_name != NULL            /* TRUE */
                      && fsym->ns->proc_name->attr.is_bind_c)   /* TRUE */

So the problem is that fsym->backend_decl is NULL.  I am not sure how
to address this.

Steve Ellcey
sje@cup.hp.com



More information about the Fortran mailing list