public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/66725] New: Issue with silent conversion int to char, struggling in gfc_widechar_to_char
@ 2015-07-01 16:28 gerhard.steinmetz.fortran@t-online.de
  2015-07-01 16:30 ` [Bug fortran/66725] " gerhard.steinmetz.fortran@t-online.de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-07-01 16:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66725

            Bug ID: 66725
           Summary: Issue with silent conversion int to char, struggling
                    in gfc_widechar_to_char
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fortran@t-online.de
  Target Milestone: ---

Sometimes a silent conversion from integer to character occurs
where it should not IMO, but should give an explicit error instead.
If this integer value n is too "large" (n > 255 or n < -255),
an ICE occurs (gfc_widechar_to_char).

This happens for several io statements and several specifiers.
An integer value at this place is wrong anyway.
Required is e.g. a scalar-default-char-expr.
Maybe wrong caret position is an aftereffect.


$ cat z_iostmt_status_257.f90
program p
   open (1, status=257)
end


$ gfortran -g -Wall -fcheck=all -fno-frontend-optimize z_iostmt_status_257.f90
f951: internal compiler error: in gfc_widechar_to_char, at
fortran/scanner.c:197


---

$ cat z_iostmt_status_100.f90
program p
   open (1, status=100)   ! wrong data type !<<<
end

$ gfortran -g -Wall -fcheck=all -fno-frontend-optimize z_iostmt_status_100.f90
z_iostmt_status_100.f90:2:48:

    open (1, status=100)   ! wrong data type !<<<
                                                1
Error: STATUS specifier in OPEN statement at (1) has invalid value 'd'


---

$ cat z_iostmt_asynchronous_999.f90
program p
   write (1, asynchronous=999)
end


$ gfortran z_iostmt_asynchronous_999.f90
f951: internal compiler error: in gfc_widechar_to_char, at
fortran/scanner.c:197


---

$ cat z_iostmt_asynchronous_104.f90
program p
   write (1, asynchronous=104)   ! wrong data type !<<<
end


$ gfortran z_iostmt_asynchronous_104.f90
z_iostmt_asynchronous_104.f90:2:55:

    write (1, asynchronous=104)   ! wrong data type !<<<
                                                       1
Error: ASYNCHRONOUS specifier in WRITE statement at (1) has invalid value 'h'


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

end of thread, other threads:[~2015-07-17  0:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-01 16:28 [Bug fortran/66725] New: Issue with silent conversion int to char, struggling in gfc_widechar_to_char gerhard.steinmetz.fortran@t-online.de
2015-07-01 16:30 ` [Bug fortran/66725] " gerhard.steinmetz.fortran@t-online.de
2015-07-02 21:40 ` [Bug fortran/66725] Issue with silent conversion int to char, ICE if int too large kargl at gcc dot gnu.org
2015-07-04 15:37 ` kargl at gcc dot gnu.org
2015-07-04 15:40 ` kargl at gcc dot gnu.org
2015-07-16 18:21 ` kargl at gcc dot gnu.org
2015-07-16 19:06 ` kargl at gcc dot gnu.org
2015-07-17  0:32 ` kargl at gcc dot gnu.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).