When that text output has remained consistent for decades(?) can you really consider it an undocumented format?
Text output, particularly warnings and notes, isn't usually intentioned to be machine parseable and consistent in the first place, but rather is meant for humans to read and may be changed to be better read by humans at will.
https://gcc.gnu.org/onlinedocs/gnat_ugn/Output-and-Error-Mes...