[LLVMdev] misc. patches

Chris Lattner sabre at nondot.org
Mon Dec 13 08:53:47 PST 2004

On Mon, 13 Dec 2004, Jeff Cohen wrote:

> VS has a 64-bit portability mode, where it will complain when it sees 
> non-portable code.  I haven't tried it yet on LLVM, but in my experience it 
> will generate a *lot* of warnings.  Every time a size_t or ptrdiff_t is 
> assigned to an int or even a long it will complain (Microsoft defines long as 
> 32-bits, even in win64).  On the other hand, gcc defines long as 64-bits on 
> 64-bit Unix (so what does it do on cygwin or mingw?).  The portability 
> warnings are still useful, but it does mean that "long" must be banished from 
> the code.

I think that the 'bad' habit that occurs in LLVM code is assuming that 
'int' is 32-bits and 'long long' is 64-bit.  I don't think that these 
assumptions fail on any machine that we currently care about, though if 
desired, these could be cleaned up.  I don't think we use 'long' 
extensively (it varies in sizes on hosts we already support well, so it 
can't be trusted ;-).  As you're noticing, we do assume that 'unsigned' 
can hold various STL size_types though.


>> Next the warnings.patch file contains some minor modification to make 
>> Visual Studio shut up (and possibly to make LLVM more 64bit friendly).
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list