# Omitting implicit none

**URL:** <https://fortran-lang.discourse.group/t/omitting-implicit-none/4010>\
**Category:** Help\
**Created:** [July 16, 2022, 6:57am UTC](https://fortran-lang.discourse.group/t/omitting-implicit-none/4010 "2022-07-16T06:57:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [July 16, 2022, 6:57am UTC](https://fortran-lang.discourse.group/t/omitting-implicit-none/4010/1 "2022-07-16T06:57:59Z")

</div>

I always use the -fimplicit-none and -Wall GFortran flags. I am curious if I omit -fimplicit-none, will -Wall be able to catch implicit type issues?

---

<div class="post-metadata">

**Author:** ![nshaffer](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nshaffer/32/161_2.png) [@nshaffer](https://fortran-lang.discourse.group/u/nshaffer)\
**Post date:** [July 16, 2022, 11:41am UTC](https://fortran-lang.discourse.group/t/omitting-implicit-none/4010/2 "2022-07-16T11:41:58Z")

</div>

No. Compare the documentation entry for -fimplicit-none (under Dialect Options) versus -Wall (under Error and Warning Options)

> **[Invoking GNU Fortran (The GNU Fortran Compiler)](https://gcc.gnu.org/onlinedocs/gfortran/Invoking-GNU-Fortran.html#Invoking-GNU-Fortran)**
>
> Invoking GNU Fortran (The GNU Fortran Compiler)

---

<div class="post-metadata">

**Author:** ![RonShepard](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@RonShepard](https://fortran-lang.discourse.group/u/RonShepard)\
**Post date:** [July 16, 2022, 5:29pm UTC](https://fortran-lang.discourse.group/t/omitting-implicit-none/4010/3 "2022-07-16T17:29:33Z")

</div>

If -Wall warned for implicitly typed variables, which are part of standard fortran, then a programmer might be swamped with false positive warning messages, making the actual error messages difficult to identify. For programmers who use implicit typing, it would be necessary to introduce a switch that would override that part of -Wall.

---

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [July 23, 2022, 8:16pm UTC](https://fortran-lang.discourse.group/t/omitting-implicit-none/4010/4 "2022-07-23T20:16:14Z")

</div>

If I omit both -fimplicit-none and -Wall for compilation and omit implicit none in Fortran codes, what unexpected errors might I get? I have yet to see an example like that.

---

<div class="post-metadata">

**Author:** ![RonShepard](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@RonShepard](https://fortran-lang.discourse.group/u/RonShepard)\
**Post date:** [July 23, 2022, 9:04pm UTC](https://fortran-lang.discourse.group/t/omitting-implicit-none/4010/5 "2022-07-23T21:04:50Z")

</div>

Something like this would be the typical error

```auto
i0 = 1
write(*,*) iO
end

```

In case you can’t tell, the Zero and Oh are different characters. Implicit none catches these kinds of typographical errors. In this case, the code is nonconforming because iO is undefined, but in other cases, the code might be conforming but just doesn’t do what is expected.

---

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [July 23, 2022, 9:07pm UTC](https://fortran-lang.discourse.group/t/omitting-implicit-none/4010/6 "2022-07-23T21:07:01Z")

</div>

Thanks for the clarification. This is a perfect example!
