Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWR007: Suggest using implicit none (external) #50

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/test-benchmark-script.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# IMPORTANT NOTE: The results of these benchmarks are not representative. This
# is simply a smoke test to check everything compiles and runs.

on:
push:
paths:
- '.github/workflows/**'
- 'Benchmark/**'
- '**/*.c'
- '**/*.cpp'
- '**/*.h'
- '**/*.f'
- '**/*.F'
- '**/*.f90'
- '**/*.F90'

jobs:
# Let us run this job on Ubuntu only as it is the only image that has gcc,
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@

on:
push:
paths:
- '.github/workflows/**'
- 'Benchmark/**'
- '**/*.c'
- '**/*.cpp'
- '**/*.h'
- '**/*.f'
- '**/*.F'
- '**/*.f90'
- '**/*.F90'

jobs:
compile-and-run:
Expand Down
13 changes: 10 additions & 3 deletions Checks/PWR007/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ legibility of the code. It can be disabled by adding an `implicit none`
statement.

> [!NOTE]
> Implicit data typing may lead to unexpected runtime errors. For example, it may
> change the results of the program due to implicit data typing determining the
> type of operation used in computations. Note the example code below shows
> Implicit data typing may lead to unexpected runtime errors. For example, it
> may change the results of the program due to implicit data typing determining
> the type of operation used in computations. Note the example code below shows
> issues with integer/real division operations due to implicit data typing.

> [!TIP]
> Starting with Fortran 2018, it is possible to use the extended form
> `implicit none (type, external)` to disable both implicit variables and
> implicit procedures, which are called through implicit interfaces. This
> approach mitigates the risks associated with such procedures, as outlined in
> [PWR068](/Checks/PWR068/).

### Code example

In the following example, the data type of all the variables is determined
Expand Down