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

            Bug ID: 115390
           Summary: Bogus -Wuninitialized warning when using CHARACTER(*)
                    argument in BIND(C) function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daklishch at gmail dot com
  Target Milestone: ---

The following code produces -Wuninitialized warning when compiled with -Wall.

MODULE test
IMPLICIT NONE
CONTAINS
    SUBROUTINE foo(s)
        CHARACTER(*), INTENT(IN) :: s
    END

    SUBROUTINE bar(s) BIND(C)
        CHARACTER(*), INTENT(IN) :: s
        CALL foo(s)
    END
END

Quick look at the tree right after the frontend reveals that indeed, something
fishy is going on.

Godbolt link: https://godbolt.org/z/TfnKb1fPT

Reply via email to