gcc/ada/gnatvsn.adb assumes that the version_string defined in gcc/version.c
never exceeds a maximum length which it defines to be 32 (in
gcc/ada/gnatvsn.ads). Under certain circumstances (e.g. experimental GCC with
a date, plus a version suffix), this assumption is wrong. The function
GNATVSN.Gnat_Version_String has a bug whereby it will raise Constraint_Error if
it reaches the end of the 32 characters before finding a null character.
The attached patch fixes both problems by increasing the maximum length, and
fixing the function so it never raises an exception.
--
Ludovic Brenta.
--
Summary: raised CONSTRAINT_ERROR : gnatvsn.adb:60 index check
failed
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ludovic at ludovic-brenta dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27194