Skip to content

missing-intrinsic (C122)

This rule is turned on by default.

What it does

Checks whether use statements for intrinsic modules specify intrinsic or non_intrinsic.

Why is this bad?

The compiler will default to using a non-intrinsic module, if there is one, so not specifying the intrinsic modifier on intrinsic modules may lead to the compiler version being shadowed by a different module with the same name.

Example

! Not recommended
use :: iso_fortran_env, only: int32, real64

! Better
use, intrinsic :: iso_fortran_env, only: int32, real64

This ensures the compiler will use the built-in module instead of a different module with the same name.

This feature is only available in Fortran 2003 and later.