[LLVMdev] Reference Manual Clarifications 2

Jon Sargeant delta17 at cox.net
Mon Apr 21 16:17:27 PDT 2008


>>>> I'm not necessarily saying that NumElements should be 
>>>> signed, only that the choice between signed and unsigned is not obvious.
>>> Obviously, obviousness is in the eye of the beholder :-)
>>> (SCNR)
>> Yes.  But consider that there are many people who agree with me.  Search 
>> for "unsigned vs signed - Is Bjarne Mistaken?" in comp.lang.c++.moderated.
> 
> Just look at any part of news:comp.lang.functional and you'll see the
> exact opposite sentiment. 
> 
> Arguments by majority aren't entirely irrelevant, but they are weak, and
> stronger arguments have been given already.

<snip>

You've missed the point.  I habitually use signed integers for counts, 
so naturally, I assumed that NumElements was signed, and I wondered what 
would happen if NumElements was negative.  It was only after asking 
Chris that I discovered that NumElements was unsigned.  Since many other 
people habitually use signed integers for counts, many other people 
might make the same mistaken assumption when reading the LLVM documentation.

Best Regards,
Jon



More information about the llvm-dev mailing list