• Should USE renaming affect NAMELIST?

    From pmk@21:1/5 to All on Sat Jun 4 09:36:58 2022
    module m
    integer :: name_in_module = 123
    end module

    use m, name_in_program => name_in_module
    namelist /nl/ name_in_program
    write(*,nl)
    end


    I have 3 compilers that emit NAME_IN_MODULE and four that emit NAME_IN_PROGRAM. I think that the latter is correct due to "Each object designator shall begin with a name from the namelist-group-object-list (8.9) ..." in 13.11.2.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From steve kargl@21:1/5 to pmk on Sat Jun 4 18:32:57 2022
    pmk wrote:

    module m
    integer :: name_in_module = 123
    end module

    use m, name_in_program => name_in_module
    namelist /nl/ name_in_program
    write(*,nl)
    end


    I have 3 compilers that emit NAME_IN_MODULE and four that emit NAME_IN_PROGRAM. I think that the latter is correct due to "Each object designator shall begin with a name from the namelist-group-object-list (8.9) ..." in 13.11.2.

    I agree with your analysis. I also created a gfortran PR and a patch.

    https://gcc.gnu.org/pipermail/gcc-bugs/2022-June/789381.html

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)