[vtk-developers] Unused Template Warnings

Sujin Philip sujin.philip at kitware.com
Wed Aug 2 15:30:52 EDT 2017


I think it should be OK to remove `static`.

Thanks
Sujin


On Wed, Aug 2, 2017 at 3:10 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> I wonder... perhaps clang only warns about these templates because they
> are declared as "static".  It's generally expected that static functions
> will be used within the execution unit in which they are defined.  If the
> "static" is removed, then the compiler should treat the templates as inline
> functions and it will let the linker deal with the ODR.
>
> Is there any reason not to remove "static" from the declarations of these
> templates?
>
>  - David
>
>
> On Wed, Aug 2, 2017 at 12:51 PM, Ken Martin <ken.martin at kitware.com>
> wrote:
>
>> Hmm it seems the llvm folks added this due to some ODR violation
>> checking. That having it unused can cause it to be defined multiple times
>> in a translation unit for some reason. It is all a bit beyond me.
>>
>> On Wed, Aug 2, 2017 at 11:08 AM, Sujin Philip <sujin.philip at kitware.com>
>> wrote:
>>
>>> Hi Ken,
>>>
>>> The vtkSMPTools.h header has parallel algorithms like For and Sort. I
>>> think this warning is occurring because some files that are including this
>>> are just using Sort. So, I think this warning should be suppressed or else
>>> we may have to refactor the code, which will not be a simple fix.
>>>
>>> Thanks
>>> Sujin
>>>
>>>
>>> On Wed, Aug 2, 2017 at 10:38 AM, Ken Martin <ken.martin at kitware.com>
>>> wrote:
>>>
>>>>
>>>> Do we care about these? Are they of value? I guess the question is
>>>> should we fix or suppress?
>>>>
>>>>
>>>> /Users/builder/external/VTK-clang-rel-x86_64/Common/Core/vtkSMPToolsInternal.h:24:13: warning: unused function template 'vtkSMPTools_Impl_For' [-Wunused-template]
>>>>
>>>>
>>>> --
>>>> Ken Martin PhD
>>>> Distinguished Engineer
>>>> Kitware Inc.
>>>> 28 Corporate Drive
>>>> Clifton Park NY 12065
>>>>
>>>> This communication, including all attachments, contains confidential
>>>> and legally privileged information, and it is intended only for the use of
>>>> the addressee.  Access to this email by anyone else is unauthorized. If you
>>>> are not the intended recipient, any disclosure, copying, distribution or
>>>> any action taken in reliance on it is prohibited and may be unlawful. If
>>>> you received this communication in error please notify us immediately and
>>>> destroy the original message.  Thank you.
>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Search the list archives at: http://markmail.org/search/?q=
>>>> vtk-developers
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://public.kitware.com/mailman/listinfo/vtk-developers
>>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170802/79fec3f9/attachment-0001.html>


More information about the vtk-developers mailing list