[LLVMdev] cygwin build patch

Gordon Henriksen gordonhenriksen at me.com
Wed Jan 21 09:55:06 PST 2009


Using an explicit instantiation, e.g. std::min<uint32_t>(), is  
sometimes a good fix and more succinct than an casting one of the  
arguments.

On 2009-01-20, at 04:22, Jay Foad wrote:

>>> I realise that the DataTypes.h.in part might be controversial. Also,
>>> there's probably a better place to put it, but I'm not sure where.
>>
>> I didn't apply this part.  What problems does it cause to not have
>> this?  Can we fix uses of max and min?
>
> I get these errors in lib:
>
> .../lib/Analysis/ValueTracking.cpp:162: error: no matching function
> for call to 'min(unsigned int&, uint32_t&)'
> .../lib/Analysis/ValueTracking.cpp:163: error: no matching function
> for call to 'min(unsigned int&, uint32_t&)'
> .../lib/Analysis/ValueTracking.cpp:358: error: no matching function
> for call to 'min(unsigned int&, uint32_t)'
> .../lib/Analysis/ValueTracking.cpp:469: error: no matching function
> for call to 'min(unsigned int&, long unsigned int)'
> .../lib/Analysis/ValueTracking.cpp:708: error: no matching function
> for call to 'min(unsigned int&, uint32_t)'
> .../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1432: error: no matching
> function for call to 'max(long unsigned int, unsigned int&)'
> .../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1747: error: no matching
> function for call to 'min(unsigned int&, uint32_t)'
> .../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2033: error: no matching
> function for call to 'min(unsigned int&, uint32_t)'
>
> I could try to fix this by changing the code to consistently use
> either unsigned or uint32_t (which?), rather than both. Or by adding
> casts at the point of calling min/max. What would you prefer?
>
> Thanks,
> Jay.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



— Gordon





More information about the llvm-dev mailing list