[J3] BOZ in an array constructor

Malcolm Cohen malcolm at nag-j.co.jp
Sun Jul 7 20:05:54 EDT 2019


> Well, yes that's my point. A BOZ cannot appear in an array
> constructor via C7110 or C7111.

 

No, C7110 and C7111 remain completely irrelevant.

 

> For INT([z'12', z'23']),

 

Violates C7109.

 

> then is the following valid INT([4.2, z'12'])?

 

Still violates C7109.

 

***End Of The Standard Story.***

 

Now, all compilers offer non-standard extensions. Permitting BOZ outside DATA/INT/REAL/DBLE/CMPLX is a very common one, unfortunately with different compilers providing different semantics. For example, the NAG compiler (and at least one other) follows the Fortran 90 wording of BOZ which said it was an integer literal (in base 2, 8 or 16); many others follow a rather complicated “typeless” rule where it refers to the internal representation.

 

If you use the appropriate “warn me about non-standard stuff” option, you should see diagnostics for your above examples. (The standard requires that compilers produce such diagnostics on request, as it is a constraint violation.)

 

Cheers,

-- 

..............Malcolm Cohen, NAG Oxford/Tokyo.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20190708/3a24fe2b/attachment.html>


More information about the J3 mailing list