lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Fixing build with clang 7 and 64-bit Linux


From: Vadim Zeitlin
Subject: Re: [lmi] Fixing build with clang 7 and 64-bit Linux
Date: Tue, 13 Nov 2018 18:35:09 +0100

On Tue, 13 Nov 2018 17:21:02 +0000 Greg Chicares <address@hidden> wrote:

GC> I'm coming around to the position that the standard is defectively unclear;

 I do agree that it's unclear. Whether it's a defect or just me being
obtuse, I don't know.

GC> In that case, this N3110 observation
GC> 
GC> | However the definition for fmtflags above does not have well-specified
GC> | behaviour if the underlying type is smaller than int, because ~int(f) is
GC> | likely to produce a value outside the range of fmtflags.
GC> 
GC> remains valid, and one possible correction would be:
GC> 
GC> - To clear a value Y in an object X is to evaluate the expression X &= ~Y.
GC> + To clear a value Y in an object X is to evaluate the expression
GC> + static_cast<bitmask>(~static_cast<int_type>(X)).
GC> 
GC> I'm pushing a change that does something like that. It works with gcc-7.3;
GC> please let me know if it doesn't avoid clang warnings.

 It does work with clang too, thanks for applying this and the other fixes!
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]