[vtk-developers] Some interesting warnings from the clang compiler

Bill Lorensen bill.lorensen at gmail.com
Thu Jul 29 17:52:50 EDT 2010


This sort of thing exposes our dirty laundry.

Hopefully we're not doing surgery, launching satellites, etc...

Bill

On Thu, Jul 29, 2010 at 5:50 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Sean,
>
> And
> vtkFunctionParser is only 560/1188 lines tested (53%).
> BTW: The code in question is not tested.
>
>
> Bill
>
> On Thu, Jul 29, 2010 at 5:42 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> Sean,
>>
>> It should be:
>>
>>  = {space} -
>> NOT
>>  =-
>>
>> Some compilers still treat =- as -=.
>>
>> It takes an old guy to remember when =- was the preferred way.
>>
>> Bill
>>
>> On Thu, Jul 29, 2010 at 5:35 PM, Sean McBride <sean at rogue-research.com> wrote:
>>> Bill,
>>>
>>> The code is currently:
>>>
>>>  case VTK_PARSER_UNARY_MINUS:
>>>   this->Stack[stackPosition] =- this->Stack[stackPosition];
>>>   break;
>>>
>>> Are you saying that it should indeed be "-="?  Otherwise, there's no
>>> error, only confusing whitespace.
>>>
>>> Sean
>>>
>>>
>>> On Thu, 29 Jul 2010 17:27:26 -0400, Bill Lorensen said:
>>>
>>>>That's a great warning. Looking at the code, obviously an error. Nice
>>>>catch clang... I think that code has been wrong since it was written
>>>>over 11 years ago. Guess it was never tested. Nor has 35% of vtk.
>>>>
>>>>Bill
>>>>
>>>>On Thu, Jul 29, 2010 at 9:26 AM, Michael Halle <mhalle at bwh.harvard.edu>
>>> wrote:
>>>>> Originally, C supported syntax like =- as a synonym for -=, but
>>>>deprecated it because it was error prone (it relied on whitespace for
>>>>disambiguation). I think that's what the warning means. Just put spaces
>>>>around the equals sign.
>>>>>
>>>>> -Mike
>>>>>
>>>>>
>>>>>
>>>>> On Jul 29, 2010, at 8:56 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>>>>>
>>>>>> The clang compiler has found some interesting warnings.  Can someone
>>>>>> look into the vtkFunctionParser one?  I'll deal with the Tcl wrapper
>>>>>> ones.
>>>>>>
>>>>>> vtk-git/Common/vtkFunctionParser.cxx:555:36: warning: use of unary
>>>>>> operator that may be intended as compound assignment (-=)
>>>>>>         this->Stack[stackPosition] =- this->Stack[stackPosition];
>>>>>>
>>>>>> vtk-git-clang/Common/vtkObjectTcl.cxx:153:27: warning: conversion
>>>>>> specifies type 'unsigned short' but the argument has type 'int'
>>>>>> [-Wformat]
>>>>>>     sprintf(tempResult,"%hu",temp20);
>>>>>> [ditto for several other tcl-wrapped objects]
>>>>>>
>>>>>> Full list here:
>>>>>>
>>>>>> http://www.cdash.org/CDash/viewBuildError.php?type=1&buildid=678985
>>>
>>>
>>>
>>
>



More information about the vtk-developers mailing list