[vtk-developers] Naming variables in function definitions

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Dec 9 16:21:39 EST 2009


One of the accepted ways of dealing with such cases is:

static float RadiansFromDegrees( float vtkNotUsed(degrees) );

vtkNotUsed() macro results in the compiler not seeing "degrees" at
all, while the code still remains readable/document-able.

Utkarsh

On Wed, Dec 9, 2009 at 4:17 PM, Berk Geveci <berk.geveci at kitware.com> wrote:
> I wonder if you need to remove the variable in the function
> declaration to avoid warning or just in the function definition. David
> could always try one of these and see if the dashboard produces any
> warnings. Btw, I recommend turning on most of the compiler warnings.
> At least as much as the dashboards turn on.
>
> On Wed, Dec 9, 2009 at 4:08 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> Depending on the situation, this may cause warnings by some compilers.
>> This will occur if the body of the method is present and the variable
>> is not used.
>>
>> Also, remember if you change anything other than a comment, always
>> recompile, run the tests and check the dashboard for at least a day
>> for errors, failing tests or warnings.
>>
>> On Wed, Dec 9, 2009 at 3:32 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
>>> Under my "limited write access" contract, is it OK if I name currently
>>> unnamed variables in function declarations? e.g. change
>>>
>>>  static float RadiansFromDegrees( float );
>>>
>>> to
>>>
>>>  static float RadiansFromDegrees( float degrees);
>>>
>>> Thanks,
>>>
>>> David
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>>
>>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



More information about the vtk-developers mailing list