Skip to content

Provide a do nothing function. #316

@awvwgk

Description

@awvwgk

This is a proposal to implement a function that does nothing with its input arguments. I used a function like the one below to do nothing but acknowledge a compiler warning on an used dummy argument, which wasn't needed in the given context but couldn't be removed from the function signature. What do you think is there a need for such function in stdlib?

!> Do nothing but mark an unused dummy argument as such to acknowledge compile
!> time warning like:
!>
!>   Warning: Unused dummy argument ‘dummy’ at (1) [-Wunused-dummy-argument]
!>
!> We deeply trust in the compiler to inline and optimize this piece of code away.
elemental subroutine unused_dummy_argument(dummy)
  class(*), intent(in) :: dummy
  associate(dummy => dummy); end associate
end subroutine unused_dummy_argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: utilitiescontainers, strings, files, OS/environment integration, unit testing, assertions, logging, ...wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions