public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* BOZ, F2008 and F2015, and future of gfortran
@ 2017-10-05 21:10 Steve Kargl
  2017-10-06  4:36 ` Jerry DeLisle
  0 siblings, 1 reply; 7+ messages in thread
From: Steve Kargl @ 2017-10-05 21:10 UTC (permalink / raw)
  To: fortran

Simply question.  Do people want gfortran to conform to
the F2008 and F2015 standards for boz-literal-constants?
Are people willing to let go of extension?

Consider

program boz
   implicit none
   integer(1) :: i = z'deadbeef'  ! Nonstandard initialization but
   integer(1) j                   ! accepted as-if initialized through
   data j/z'deadbeef'/            ! a data-stmt
   print *, i, j
end program boz

gfortran's current behavior with long lines wrap.

% gfortran6 -static -o z z.f90
z.f90:3:20:

    integer(1) :: i = z'deadbeef'
                    1
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(1) at (1).
This check can be disabled with the option '-fno-range-check'
z.f90:6:13:

    print *, i, j
             1
Error: Symbol 'i' at (1) has no IMPLICIT type
z.f90:5:21:

    data j/z'deadbeef'/
                     1
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(1) at (1).
This check can be disabled with the option '-fno-range-check'
A conforming version of

gfortran conforming to the F2008 and F2015 standards.
% gfcx -o z z.f90 && ./z
  -17  -17

-- 
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-06 17:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 21:10 BOZ, F2008 and F2015, and future of gfortran Steve Kargl
2017-10-06  4:36 ` Jerry DeLisle
2017-10-06  5:02   ` Steve Kargl
2017-10-06  5:59     ` Richard Biener
2017-10-06  6:20       ` Steve Kargl
2017-10-06 11:50         ` Richard Biener
2017-10-06 17:03           ` Steve Kargl

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).