This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ping2][PATCH v2][BZ #12515] Improve precision of clock function


On 06/10/2013 06:40 PM, Rich Felker wrote:
> First, to make the code work as-is
> with the wrapping behavior, the values should just be converted to the
> appropriate unsigned types so that the wrapping is well-defined, then
> converted, either via a cast or implicitly, back to the right type.

That's more work and harder to understand and more
error-prone than the pragma.  For one thing, there's
no simple way to determine the "appropriate
unsigned type".  And why bother?  The code is designed
to be compiled by GCC, so the pragma should suffice.

> This conversion takes place in an implementation-defined way

Which is another reason to prefer the pragma.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]