[Fortran] format strings may generate indistinguishable output
Format strings like '(5I0)' will generate single long number. Most of time, it is undesired behaviour.
Example:
program main
print '(3I0)', [11, 22, 33]
print '(3I0)', [112, 23, 3]
end program main
The same issue is for real type. For logical type, it is not a problem.
Hi @foxtran,
I agree! That does look more like a typical source of errors rather than a behavior someone would usually leverage.
As usual, we'll keep this issue open to not lose track of the idea. And as always, feel free to open a PR if you'd like to suggest an entry for this potential check!
Steps for adding a new recommendation (click me)
-
Each recommendation resides in its own directory under
Checks/. Create the directory and update the list of checks in theREADME.mdat the root of the repository. -
Add a
README.mdfile that includes the following:-
Title: ID (e.g., the next available
PWRnumber) + Name of the recommendation. - Issue: A brief description (1-2 sentences) of how the discouraged practice impacts the code.
- Actions: A brief explanation (1-2 sentences) of how to refactor the code from the discouraged to the encouraged practice.
- Relevance: A more detailed explanation of why adopting the recommended practice is beneficial, expanding on the previous points.
- Code examples: Include a before-and-after code example to illustrate the improvement.
- References: Add links or references for further reading, if available.
-
Title: ID (e.g., the next available
-
Create standalone
exampleandsolutionsource files containing the code examples. -
Optionally, include a benchmark demonstrating the before-and-after performance impact of the change. In cases like this, the expectation is that the performance of the code should not degrade.
For reference, feel free to check out previous PRs to see how these steps are implemented in practice. For example, this is the PR that added PWR075.
Naturally, don't hesitate to ask at any moment if you have any issues. We'll be glad to help!