Landing: 15c74ac9fdc6
Project / Subsystem
gcc / gcc/ada
Date
2026-05-14
Author
Viljar Indus
Commit
15c74ac9fdc69646f83238cac70d1bae36cb377e
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/ada
- patch_id
- —
- commit_hash
- 15c74ac9fdc69646f83238cac70d1bae36cb377e
- source_type
- github
- headline
- The Ada front end guards against empty switches in `Getopt`
- tldr
- The Ada front end's command-line parsing utility `GNAT.Command_Line.Getopt` now safely handles empty switch strings, preventing potential errors.
- author
- Viljar Indus
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • ada
- • runtime
- • bugfix
- • safety
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-05-14T00:00:00.000Z
This commit enhances the robustness of GNAT.Command_Line.Getopt within the libgnat runtime by adding guards against empty switch strings. Previously, checks for the first character of Switches did not always account for an empty input string, potentially leading to errors. The updated Getopt function now explicitly checks if Switches are empty before attempting to access their first element, preventing crashes in scenarios with malformed command-line arguments.