[J3] BLOCK DATA and BIND(C) question

Steven G. Kargl kargl at uw.edu
Tue Feb 1 20:49:45 UTC 2022


Thanks for the reply.  I suppose that I'm misreading
C1415.  Restricting it to BIND.  I read this as

C1415  (R1420) A block-data specification-part shall contain
       BIND statements.

The first example has only a BIND(C) statement in the specification-part.
But, I suppose C819 applies and 'A' cannot be a variable.  So, it is
invalid code.  If I then look at C818, which permits a common block,
then the BIND statement in C1415 would apply to the following:

block data
   common /a/x
   bind(c) :: /a/
end block data

-- 
steve


On Tue, Feb 01, 2022 at 08:17:01PM +0000, Bader, Reinhold via J3 wrote:
> Steve, 
> 
> an entity referenced by a BIND statement in a BLOCK DATA program unit must
> be a common block. 
> Hence, all three examples you give are non-conforming. 
> 
> I think this also implies that the cited constraints are not internally
> contradictory.
> 
> Cheers
> Reinhold
> 
> > -----Ursprüngliche Nachricht-----
> > Von: J3 <j3-bounces at mailman.j3-fortran.org> Im Auftrag von Steven G.
> > Kargl via J3
> > Gesendet: Dienstag, 1. Februar 2022 20:08
> > An: J3 Fortran <j3 at mailman.j3-fortran.org>
> > Cc: Steven G. Kargl <kargl at uw.edu>
> > Betreff: [J3] BLOCK DATA and BIND(C) question
> > 
> > Are these code snippets equivalent?
> > 
> > BLOCK DATA
> >    BIND(C) :: A
> > END BLOCK DATA
> > 
> > BLOCK DATA
> >    REAL :: A
> >    BIND(C) :: A
> > END BLOCK DATA
> > 
> > BLOCK DATA
> >    REAL, BIND(C) :: A
> > END BLOCK DATA
> > 
> > 
> > If yes, do C1415 and C1416 conflict?
> > 
> > C1415 (R1420) A block-data specification-part shall contain
> >       only derived-type definitions and ..., BIND, ..., and
> >       type declaration statements.
> > 
> > C1416 (R1420) A type declaration statement in a block-data
> >       specification-part shall not contain ALLOCATABLE, EXTERNAL,
> >       or BIND attribute specifiers.
> > 
> > In fact, does C1415 conflict with C819?
> > 
> > C819 A variable with the BIND attribute shall be declared in
> >      the specification part of a module.
> > 
> > --
> > Steve



-- 
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3950 bytes
Desc: not available
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20220201/d07f3b1e/attachment.bin>


More information about the J3 mailing list