This is the mail archive of the libc-alpha@sources.redhat.com 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: pread, pwrite linux implementation does not conform to SingleUnix Specification


On Wed, 2002-07-17 at 11:52, Andreas Schwab wrote:

> -			   __LONG_LONG_PAIR (0, offset));
> +			   __LONG_LONG_PAIR (-(offset < 0), offset));

Why do you use

  -(offset < 0)

instead of

  offset >> (sizeof (offset) * 8 - 1)

gcc 3.2 (well 3.3) will optimize the former to produce exactly the code
the latter code suggests but earlier versions of the compiler cannot do
this.  They need three instruction.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

Attachment: signature.asc
Description: This is a digitally signed message part


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