public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38386] New: Update BIND(C,name= checking for Fortran 2008
@ 2008-12-03 16:40 burnus at gcc dot gnu dot org
2009-01-04 0:49 ` [Bug fortran/38386] " dfranke 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 @ 2008-12-03 16:40 UTC (permalink / raw)
To: gcc-bugs
At the J3 / WG5 mailing list (reply by Bill Long):
Reinhold Bader wrote:
> >
> > before taking this offline, I'd like to understand something about BIND(C)
> > which other people might know ...
> >
> > Take the following example program:
> >
> > module mod_label_interf
> > use, intrinsic :: iso_c_binding
> > implicit none
> > interface foo
> > subroutine foo_1(x, n, i) bind(c, name='Foo')
> > import :: c_float, c_int
> > real(c_float) :: x
> > integer(c_int), value :: n, i
> > end subroutine
> > subroutine foo_2(x, n, i) bind(c, name='Foo')
> > import :: c_float, c_int
> > real(c_float) :: x(*)
> > integer(c_int), value :: n, i
> > end subroutine
> > end interface
> > end module
> > program label_interf
> > use mod_label_interf
> > implicit none
> > integer(c_int) :: i
> > real(c_float) :: xx, xxx(3)
> > i = 2
> > call foo(xx, 1, i)
> > call foo(xxx, 3, i)
> > write(*, *) xx
> > write(*, *) xxx
> > end program
> >
> > together with the C implementation
> >
> > #include <math.h>
> >
> > void Foo(float *x, int n, int i) {
> > int j;
> > for (j=0; j<n; j++) {
> > *(x+j) = (float) (i + j) + 0.1;
> > }
> > }
> >
> > This code is accepted by various processors and executes in accordance with my
> > personal expectations (for what that is worth :-)).
> > It is not accepted by NAG's compiler, and also not by IBM xlf. NAG's error message is
> >
> > Error: label_interf.f90: Duplicate binding label 'Foo' for external procedure FOO_2 and external procedure FOO_1
> >
This error message is consistent with the Fortran 2003 rules. An
(non-abstract) interface declares the procedure name to be external.
However, in the case of a separate binding label, that rule is being
changed in Fortran 2008 to be the way you want it. If there is a
separate binding label then the procedure's name becomes a local name,
not external.
--
Summary: Update BIND(C,name= checking for Fortran 2008
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38386
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/38386] Update BIND(C,name= checking for Fortran 2008
2008-12-03 16:40 [Bug fortran/38386] New: Update BIND(C,name= checking for Fortran 2008 burnus at gcc dot gnu dot org
@ 2009-01-04 0:49 ` dfranke at gcc dot gnu dot org
2009-03-29 8:03 ` [Bug fortran/38386] Update BIND(C,name=) " fxcoudert at gcc dot gnu dot org
2010-05-09 14:08 ` dfranke at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-01-04 0:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dfranke at gcc dot gnu dot org 2009-01-04 00:48 -------
See also PR35161.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
OtherBugsDependingO| |32630
nThis| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38386
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/38386] Update BIND(C,name=) checking for Fortran 2008
2008-12-03 16:40 [Bug fortran/38386] New: Update BIND(C,name= checking for Fortran 2008 burnus at gcc dot gnu dot org
2009-01-04 0:49 ` [Bug fortran/38386] " dfranke at gcc dot gnu dot org
@ 2009-03-29 8:03 ` fxcoudert at gcc dot gnu dot org
2010-05-09 14:08 ` dfranke at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-03-29 8:03 UTC (permalink / raw)
To: gcc-bugs
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-03-29 08:03:11
date| |
Summary|Update BIND(C,name= |Update BIND(C,name=)
|checking for Fortran 2008 |checking for Fortran 2008
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38386
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/38386] Update BIND(C,name=) checking for Fortran 2008
2008-12-03 16:40 [Bug fortran/38386] New: Update BIND(C,name= checking for Fortran 2008 burnus at gcc dot gnu dot org
2009-01-04 0:49 ` [Bug fortran/38386] " dfranke at gcc dot gnu dot org
2009-03-29 8:03 ` [Bug fortran/38386] Update BIND(C,name=) " fxcoudert at gcc dot gnu dot org
@ 2010-05-09 14:08 ` dfranke at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-09 14:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from dfranke at gcc dot gnu dot org 2010-05-09 14:08 -------
*** This bug has been marked as a duplicate of 35161 ***
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38386
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-09 14:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-03 16:40 [Bug fortran/38386] New: Update BIND(C,name= checking for Fortran 2008 burnus at gcc dot gnu dot org
2009-01-04 0:49 ` [Bug fortran/38386] " dfranke at gcc dot gnu dot org
2009-03-29 8:03 ` [Bug fortran/38386] Update BIND(C,name=) " fxcoudert at gcc dot gnu dot org
2010-05-09 14:08 ` dfranke 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).