[Bug fortran/46496] Missing strlen check / interop warnings with BIND(C) and non-C_* kinds

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 1 20:18:00 GMT 2018


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

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #0)

> f) The following two examples are invalid - but seemingly gfortran does not
> check the string length of DT character components:
> 
> module mytypes
>    use ISO_C_BINDING
>    implicit none
>    private
>    public T
>    type, bind(C) :: T
>       character(len=2,kind=C_CHAR) item ! INVALID length: 2
>    end type T
> end module mytypes
> 
> module mytypes
>    use ISO_C_BINDING
>    implicit none
>    private
>    public T
>    type, bind(C) :: T
>       character(len=*,kind=C_CHAR) item*(2) ! INVALID length of 2
>    end type T
> end module mytypes

This has been fixed with PR84073.


More information about the Gcc-bugs mailing list