public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/113883] New: allocatable length parameter used but is undefined
@ 2024-02-12  3:07 kargl at gcc dot gnu.org
  2024-02-12  3:09 ` [Bug fortran/113883] " kargl at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: kargl at gcc dot gnu.org @ 2024-02-12  3:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113883
           Summary: allocatable length parameter used but is undefined
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kargl at gcc dot gnu.org
  Target Milestone: ---

All,

I stumbled across the following issue with my code.  Consider, 

! { dg-do compile }
! { dg-options "-Werror -Wall" }
module foo
   contains
      subroutine bar 
         character(len=:), allocatable :: s(:)
         call bah(s)
      end subroutine bar
end module foo

Currently, if this compiled with '-Werror -Wall' the result is

% gfcx -Wall -Werror -c gcc/testsuite/gfortran.dg/allocatable_length.f90
gcc/testsuite/gfortran.dg/allocatable_length.f90:6:46:

    6 |          character(len=:), allocatable :: s(:)
      |                                              ^
Error: '.s' is used uninitialized [-Werror=uninitialized]
gcc/testsuite/gfortran.dg/allocatable_length.f90:5:20:

    5 |       subroutine bar
      |                    ^
note: '.s' was declared here
f951: all warnings being treated as errors

I tracked down the location where the issue occurs and Mikael suggested
the patch that ultimately fixes the issue.  I'll attach it in a follow-up.

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

end of thread, other threads:[~2024-02-13 17:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12  3:07 [Bug fortran/113883] New: allocatable length parameter used but is undefined kargl at gcc dot gnu.org
2024-02-12  3:09 ` [Bug fortran/113883] " kargl at gcc dot gnu.org
2024-02-12  3:09 ` kargl at gcc dot gnu.org
2024-02-12 20:00 ` jvdelisle at gcc dot gnu.org
2024-02-13  4:51 ` cvs-commit at gcc dot gnu.org
2024-02-13 17:20 ` sgk at troutmask dot apl.washington.edu

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