https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114065

--- Comment #44 from Nicolas Boulenguez <nicolas at debian dot org> ---
Created attachment 61580
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61580&action=edit
v18 truncate instead of rounding

Hello.

> To_Timeval is rounding values whereas it is currently truncating
> values. Is this change intentional?
This was a deliberate but poorly inspired change.

> Then, To_Timeval(Duration'Last) throws an exception, which is probably
> unexpected given that Duration'Last is a valid value. Do you think this can be
> fixed?
With rounding, it made sense that To_Timeval (Duration'Last), which
was rounded up, could not be converted back.

Changes in v18
 * Truncate values in both directions.
 * For timeval, reuse timespec conversions.
 * In To_Timespec, replace integer conversions with Unchecked_Conversion.
 * Replace most raw constants with formulas.
 * Describe the error conditions in the specification comments.
 * Suggest inlining for all functions.
The archive contains a diff with v17 (only s-c_time).

Reply via email to