public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32800] New: ISO Bind C: C_F_Pointer argument bogus checking
@ 2007-07-17 20:23 burnus at gcc dot gnu dot org
2007-07-23 9:32 ` [Bug fortran/32800] " burnus at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-17 20:23 UTC (permalink / raw)
To: gcc-bugs
The following fails if the FPTR argument is not the second argument.
The argument checking should be based on the ordered argument list not on the
position of the call ("FPTR=" is not always at the second position).
(Related to PR32797)
CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR,SHAPE=[strlen(cptr)])
1
Error: Argument 'cptr' to 'c_f_pointer' at (1) must have the POINTER attribute
FUNCTION C_F_STRING(CPTR) RESULT(FPTR)
USE ISO_C_BINDING
implicit none
TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address
CHARACTER(KIND=C_CHAR), DIMENSION(:), POINTER :: FPTR
INTERFACE
FUNCTION strlen(string) RESULT(len) BIND(C,NAME="strlen")
import
TYPE(C_PTR), VALUE :: string ! A C pointer
integer(c_int) :: len
END FUNCTION
END INTERFACE
CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR,SHAPE=[strlen(cptr)])
END FUNCTION
--
Summary: ISO Bind C: C_F_Pointer argument bogus checking
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 32630
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32800
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/32800] ISO Bind C: C_F_Pointer argument bogus checking
2007-07-17 20:23 [Bug fortran/32800] New: ISO Bind C: C_F_Pointer argument bogus checking burnus at gcc dot gnu dot org
@ 2007-07-23 9:32 ` burnus at gcc dot gnu dot org
2007-07-23 17:47 ` burnus at gcc dot gnu dot org
2007-07-23 17:52 ` burnus at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-23 9:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2007-07-23 09:32 -------
Patch:
http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01543.html
Cf. also PR 32797.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32800
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/32800] ISO Bind C: C_F_Pointer argument bogus checking
2007-07-17 20:23 [Bug fortran/32800] New: ISO Bind C: C_F_Pointer argument bogus checking burnus at gcc dot gnu dot org
2007-07-23 9:32 ` [Bug fortran/32800] " burnus at gcc dot gnu dot org
@ 2007-07-23 17:47 ` burnus at gcc dot gnu dot org
2007-07-23 17:52 ` burnus at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-23 17:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2007-07-23 17:47 -------
Subject: Bug 32800
Author: burnus
Date: Mon Jul 23 17:47:16 2007
New Revision: 126856
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126856
Log:
2007-07-23 Christopher D. Rickett <crickett@lanl.gov>
PR fortran/32797
PR fortran/32800
* decl.c (verify_bind_c_sym): Use the result symbol for functions
with a result clause. Warn if implicitly typed. Verify the type
and rank of the SHAPE argument, if given.
* resolve.c (gfc_iso_c_sub_interface): Use gfc_procedure_use to
check the actual args against the formal, sorting them if
necessary.
* symbol.c (gen_shape_param): Initialize type of SHAPE param to
BT_VOID.
2007-07-23 Christopher D. Rickett <crickett@lanl.gov>
PR fortran/32797
PR fortran/32800
* gfortran.dg/bind_c_usage_8.f03: New test case.
* gfortran.dg/c_f_pointer_tests_2.f03: Ditto.
* gfortran.dg/c_ptr_tests_5.f03: Updated expected error message.
Added:
trunk/gcc/testsuite/gfortran.dg/bind_c_usage_8.f03
trunk/gcc/testsuite/gfortran.dg/c_f_pointer_tests_2.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/symbol.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/c_ptr_tests_5.f03
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32800
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/32800] ISO Bind C: C_F_Pointer argument bogus checking
2007-07-17 20:23 [Bug fortran/32800] New: ISO Bind C: C_F_Pointer argument bogus checking burnus at gcc dot gnu dot org
2007-07-23 9:32 ` [Bug fortran/32800] " burnus at gcc dot gnu dot org
2007-07-23 17:47 ` burnus at gcc dot gnu dot org
@ 2007-07-23 17:52 ` burnus at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-23 17:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from burnus at gcc dot gnu dot org 2007-07-23 17:52 -------
FIXED.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32800
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-07-23 17:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-17 20:23 [Bug fortran/32800] New: ISO Bind C: C_F_Pointer argument bogus checking burnus at gcc dot gnu dot org
2007-07-23 9:32 ` [Bug fortran/32800] " burnus at gcc dot gnu dot org
2007-07-23 17:47 ` burnus at gcc dot gnu dot org
2007-07-23 17:52 ` burnus at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).