[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 673015 (gprbuild: [hurd-i386] could not create $DIRECTORY/auto.cgpr)



Svante Signell <svante.signell@telia.com> writes:
> On Wed, 2012-06-27 at 23:03 +0200, Nicolas Boulenguez wrote:
>> > Yet, the code above tries to get the Integer'Value of Prefix, while the
>> > Default value is set to the string "@@"?
>> 
>> begin
>>    Compiler.Prefix_Index := Integer'Value (Prefix);
>> exception
>>    when Constraint_Error => Compiler.Prefix_Index := -1;
>> end;
>> 
>> When the DOM tree contains no attribute named "prefix", Prefix = "@@".
>> In that case, or else when the value cannot be interpreted as an
>> Integer, the attempted conversion triggers an exception. This is
>> intended, as the exception is catched immediately and a default
>> Integer value used instead.
>
> OK, maybe the problems are in tracebak.c. Will check out. But coding
> like that is for me a little strange, raising an exception for an
> invalid value??

Yes. The Ada Reference manual, clause 3.5(55/3), says so:

[...] For a numeric subtype S, the evaluation of a call on S'Value with
Arg of type String is equivalent to a call on S'Wide_Wide_Value for a
corresponding Arg of type Wide_Wide_String.

and

39.6/2
               For the evaluation of a call on S'Wide_Wide_Value for a
               real subtype S, if the sequence of characters of the
               parameter (ignoring leading and trailing spaces) has the
               syntax of one of the following:

39.7/2
                  * numeric_literal

39.8/2
                  * numeral.[exponent]

39.9/2
                  * .numeral[exponent]

39.10/2
                  * base#based_numeral.#[exponent]

39.11/2
                  * base#.based_numeral#[exponent]

39.12/3
               with an optional leading sign character (plus or minus),
               and if the corresponding numeric value belongs to the
               base range of the type of S, then that value is the
               result; otherwise, Constraint_Error is raised. The sign
               of a zero value is preserved (positive if none has been
               specified) if S'Signed_Zeros is True.

More seriously, I don't think you should investigate how an exception is
raised, but rather what triggers it.  I still think that gprconfig is
trying to parse the output of grep and that this output is different on
hurd-i386 than it is on all other architectures.

-- 
Ludovic Brenta.


Reply to: