File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -72,5 +72,8 @@ using Label = std::uint64_t;
72
72
73
73
// Fortran arrays may have up to 15 dimensions (See Fortran 2018 section 5.4.6).
74
74
static constexpr int maxRank{15 };
75
+
76
+ // Fortran names may have up to 63 characters (See Fortran 2018 C601).
77
+ static constexpr int maxNameLen{63 };
75
78
} // namespace Fortran::common
76
79
#endif // FORTRAN_COMMON_FORTRAN_H_
Original file line number Diff line number Diff line change @@ -198,6 +198,12 @@ void CheckHelper::Check(
198
198
}
199
199
200
200
void CheckHelper::Check (const Symbol &symbol) {
201
+ if (symbol.name ().size () > common::maxNameLen) {
202
+ messages_.Say (symbol.name (),
203
+ " %s has length %d, which is greater than the maximum name length "
204
+ " %d" _port_en_US,
205
+ symbol.name (), symbol.name ().size (), common::maxNameLen);
206
+ }
201
207
if (context_.HasError (symbol)) {
202
208
return ;
203
209
}
You can’t perform that action at this time.
0 commit comments