[vtk-developers] Unused arguments warnings

Sean McBride sean at rogue-research.com
Thu Sep 2 16:08:40 EDT 2010


On Thu, 2 Sep 2010 15:01:33 -0400, David Doria said:

>I've seen a handful of unused args warnings when compiling lately (argc and
>argv in some tests).
>
>Should I change them to
>
>int TestName(int, char*[])
>
>or
>
>int TestName(int vtkNotUsed(argc), char*vtkNotUsed(argv)[])
>
>?
>
>Is the idea of the vtkNotUsed macro just that the code explicitly says "we
>are not using this" rather than making the reader wonder if they forgot to
>name the variable?

Another option is:

int TestName(int argc, char* argv[])
{
  (void)argc;
  (void)argv;

}

which is done is some VTK files... Dunno if there is a preferred convention.

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list