[flang-commits] [flang] [flang] Fix fixed line length overflow diagnostic (PR #233353)
Youssef W. Abdallah via flang-commits
flang-commits at lists.llvm.org
Mon Oct 19 12:47:28 PDT 2026
================
@@ -870,7 +870,15 @@ static bool parseFrontendArgs(FrontendOptions &opts, llvm::opt::ArgList &args,
if (argValue == "none") {
columns = 0;
} else if (argValue.getAsInteger(/*Radix=*/10, columns)) {
- columns = -1;
+ if (!argValue.empty() &&
+ std::all_of(argValue.begin(), argValue.end(),
+ [](char c) { return c >= '0' && c <= '9'; })) {
+ // Route oversized positive decimals to the large-columns diagnostic.
+ columns =
+ static_cast<std::int64_t>(std::numeric_limits<int>::max()) + 1;
----------------
Wael-06 wrote:
Thanks for the suggestions. I initially wanted to use these helpers because I remembered reading that the LLVM coding guidelines encouraging the use of LLVM utilities, but I hesitated because they required additional includes.
I've switched to `llvm::all_of` and `llvm::isDigit`, added the corresponding headers, and added regression tests for oversized negative values through both driver entry points.
https://github.com/llvm/llvm-project/pull/233353
More information about the flang-commits
mailing list