public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/98558] New: Scalar character parameter does not print warning if actual length >1
@ 2021-01-06  9:31 federico.perini at gmail dot com
  2021-01-06 17:46 ` [Bug fortran/98558] " kargl at gcc dot gnu.org
  2021-01-07  8:32 ` federico.perini at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: federico.perini at gmail dot com @ 2021-01-06  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98558
           Summary: Scalar character parameter does not print warning if
                    actual length >1
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: federico.perini at gmail dot com
  Target Milestone: ---

Created attachment 49898
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49898&action=edit
test program

More of a suggestion than a bug (I don't see memory issues).

If I initialize a CHARACTER, PARAMETER variable with a string whose lenght is
>1, no warnings are printed in gcc/gfortran 9.2.0: 

program test_char_parameter
      implicit none
      character       , parameter :: a = 'a'      ! OK
      character       , parameter :: b = 'bbbbb'  ! NO -> No warnings printed!
      character(len=1), parameter :: c = 'ccccc'  ! NO -> No warnings printed!
      character(len=*), parameter :: d = 'ddddd'  ! OK

      print *, a
      print *, b
      print *, c
      print *, d

end program test_char_parameter

Best,
Federico

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

end of thread, other threads:[~2021-01-07  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06  9:31 [Bug fortran/98558] New: Scalar character parameter does not print warning if actual length >1 federico.perini at gmail dot com
2021-01-06 17:46 ` [Bug fortran/98558] " kargl at gcc dot gnu.org
2021-01-07  8:32 ` federico.perini at gmail dot com

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