Skip to content

Commit 6dc36e7

Browse files
sbryngelsonclaude
andcommitted
Add -Wconversion to debug builds and track in cleanliness CI
Adds -Wconversion to the GNU debug compiler flags in CMakeLists.txt. This catches implicit type coercions (e.g. integer = real truncation) at compile time. Adds a Conversion Warnings Diff step and count to cleanliness.yml, following the same delta-from-master pattern as the existing checks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c184ae2 commit 6dc36e7

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/cleanliness.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ jobs:
8686
grep -F 'Wmaybe-uninitialized' master.txt > mMaybe.txt
8787
diff prMaybe.txt mMaybe.txt
8888
89+
- name: Conversion Warnings Diff
90+
continue-on-error: true
91+
run: |
92+
grep -F 'Wconversion' pr.txt > prConversion.txt
93+
grep -F 'Wconversion' master.txt > mConversion.txt
94+
diff prConversion.txt mConversion.txt
8995
9096
- name: Everything Diff
9197
continue-on-error: true
@@ -106,12 +112,14 @@ jobs:
106112
pr_argument=$(grep -c -F 'Wunused-dummy-argument' pr.txt)
107113
pr_value=$(grep -c -F 'Wunused-value' pr.txt)
108114
pr_uninit=$(grep -c -F 'Wmaybe-uninitialized' pr.txt)
115+
pr_conversion=$(grep -c -F 'Wconversion' pr.txt)
109116
pr_everything=$(grep -c '\-W' pr.txt)
110117
111118
master_variable=$(grep -c -F 'Wunused-variable' master.txt)
112119
master_argument=$(grep -c -F 'Wunused-dummy-argument' master.txt)
113120
master_value=$(grep -c -F 'Wunused-value' master.txt)
114121
master_uninit=$(grep -c -F 'Wmaybe-uninitialized' master.txt)
122+
master_conversion=$(grep -c -F 'Wconversion' master.txt)
115123
master_everything=$(grep -c '\-W' master.txt )
116124
117125
echo "pr_everything=$pr_everything" >> $GITHUB_ENV
@@ -124,6 +132,7 @@ jobs:
124132
echo "Unused Dummy Argument: $pr_argument, Difference: $((pr_argument - master_argument))"
125133
echo "Unused Value: $pr_value, Difference: $((pr_value - master_value))"
126134
echo "Maybe Uninitialized: $pr_uninit, Difference: $((pr_uninit - master_uninit))"
135+
echo "Conversion: $pr_conversion, Difference: $((pr_conversion - master_conversion))"
127136
echo "Everything: $pr_everything, Difference: $((pr_everything - master_everything))"
128137
129138

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
150150
-fsignaling-nans
151151
-finit-real=snan
152152
-finit-integer=-99999999
153+
-Wconversion
153154
-Wintrinsic-shadow
154155
-Wunderflow
155156
-Wrealloc-lhs

0 commit comments

Comments
 (0)