[cfe-dev] compile problem with clang/Sema/SemaDecl.cpp

Chris Lattner clattner at apple.com
Mon Jan 14 14:09:46 PST 2008


On Jan 13, 2008, at 5:43 PM, Sam Bishop wrote:

> Hi, all.
>
> This weekend I compiled LLVM and clang under Cygwin.  I had a problem
> compiling both of them for the same reason: Cygwin maps the *int32_t
> types to longs instead of ints.  I have submitted a fix for LLVM, but
> for clang I punted with these heavy-handed casts:

Your patch is the right one, thanks!
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080114/003777.html

-Chris

>
> --- SemaDecl.cpp        (revision 45943)
> +++ SemaDecl.cpp        (working copy)
> @@ -1502,9 +1502,9 @@
>
>      // Keep track of the size of positive and negative values.
>      if (InitVal.isUnsigned() || !InitVal.isNegative())
> -      NumPositiveBits = std::max(NumPositiveBits,  
> InitVal.getActiveBits());
> +      NumPositiveBits = std::max(NumPositiveBits,  
> (unsigned)InitVal.getActiveBits());
>      else
> -      NumNegativeBits = std::max(NumNegativeBits,  
> InitVal.getMinSignedBits());
> +      NumNegativeBits = std::max(NumNegativeBits,  
> (unsigned)InitVal.getMinSignedBits());
>
>      // Keep track of whether every enum element has type int (very  
> commmon).
>      if (AllElementsInt)
>
> I suspect that someone who knows this code better could come up with a
> better fix.
>
> Thanks,
> Sam
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list