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: Use gen-as-const.py to process .pysym files


On Tue, 4 Dec 2018, Andreas Schwab wrote:

> On Dez 04 2018, Joseph Myers <joseph@codesourcery.com> wrote:
> 
> > The more correct positive values by themselves produce a failure of
> > nptl/test-mutexattr-printers, because masking with
> > ~PTHREAD_MUTEXATTR_FLAG_BITS & ~PTHREAD_MUTEX_NO_ELISION_NP now leaves
> > a bit -1 << 32 in the Python value, resulting in a KeyError exception.
> > To avoid that, places masking with ~ of one of the constants in
> > question are changed to mask with 0xffffffff as well (this reflects
> > how ~ in Python applies to an infinite-precision integer whereas ~ in
> > C does not do any promotions beyond the width of int).
> 
> If ~ doesn't reflect C semantics then ^ 0xffffffff would be better.

The constants in question remain negative on 32-bit systems both before 
and after this patch, so replacing ~CONST with CONST ^ 0xffffffff wouldn't 
achieve the result of removing the -1 << 32 bits.

-- 
Joseph S. Myers
joseph@codesourcery.com


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