[PATCH] Fix 'leading zeros' caveat of StringRef::compare_numeric()
    Chandler Carruth 
    chandlerc at google.com
       
    Mon Mar 30 08:19:44 PDT 2015
    
    
  
Correct.
On Mon, Mar 30, 2015 at 10:49 AM Marshall Clow <mclow.lists at gmail.com>
wrote:
> On Mon, Mar 30, 2015 at 6:26 AM, Sanne Wouda <snnw at gruttepier.net> wrote:
>
>>
>> Regarding octal numbers: I believe behaviour is unchanged.  Comparison
>> between two octal numbers (with or without leading zeroes) should work
>> as expected.  Exactly which behaviour are you worried about?
>>
>>
> I suspect that Chandler is concerned about these two case giving different
> answers:
>
>     if ( 010 < 9 ) printf ("true"); // will print.
>     if ( StringRef("010").compare_numeric("9") < 0 ) printf ("true"); //
> will NOT print.
>
> -- Marshall
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150330/44a190bb/attachment.html>
    
    
More information about the llvm-commits
mailing list