[vtk-developers] Various issues on my dashboards... help needed...

Ken Martin ken.martin at kitware.com
Thu Aug 17 09:46:30 EDT 2017


I think the warning is valuable. I do not believe it applies to general
class templates that have external linkage.

I believe in this case the error is specifically due to the fact the
templated function in question has internal linkage. By defining it  inside
an anonymous namespace the templated function cannot be used anywhere else,
and yet it is unused. So the compiler warns us.

Potential fixes could be to

- pull that struct (CheckShallowCopy) out of the anonymous namespace (I
think that changes its linkage to external)

- do an ifdef to remove the function for this test case

- declare that function in CheckShallowCopy as extern forcing it to have
external linkage

I'm not 100% sure which if any of those solutions would work but that would
be my guess. Maybe Sean could give one of them a shot on his system?


Dave here is the llvm thread I looked at last time that talks a bit about
this

https://reviews.llvm.org/D29877




On Wed, Aug 16, 2017 at 8:37 PM, David Cole via vtk-developers <
vtk-developers at vtk.org> wrote:

> In this thread :
> http://public.kitware.com/pipermail/vtk-developers/2017-August/035314.html
> , Ken Martin said
>
> "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."
>
> Despite my Google skillz, I could not find what exactly he was
> referring to, and a search on the quoted "-Wunused-template" doesn't
> help much. Or I didn't dig deep enough.
>
> Anyhow:
>
> I think you should favor limiting the disabled bit of the warning to
> the scope where you know it's safe to ignore, and not just put a
> blanket suppression on it. Each warning is useful to somebody for some
> code, and ignoring them everywhere by a global compile flag is not the
> best way to suppress a warning in a handful of files among thousands.
>
>
> Just my opinion ... but there you have it.
>
> David C.
>
>
>
>
>
> On Wed, Aug 16, 2017 at 7:06 PM, Sean McBride <sean at rogue-research.com>
> wrote:
> > On Wed, 16 Aug 2017 13:54:26 -0400, Allie Vacanti said:
> >
> >>> Allison, do you think you can work on the data array warnings?
> >>>
> >>> I think if both Allison and I take care of those it should whittle
> down the
> >>> list to a more manageable size to start getting others to help out
> with.
> >>
> >>I think we should just disable the unused-template warnings. Most of
> >>these cases depend on the ArrayDispatch configuration and can't be
> >>removed without breaking features, even though some builds don't use
> >>them.
> >
> > Allie,
> >
> > OK, so we just have to decide if we should:
> >  a) use "#pragma clang diagnostic ignored" to disable this warning for
> the ArrayDispatch file(s)
> > or
> >  b) I just add -Wno-unused-template to disable it everywhere and always
> >
> > I guess it depends if the warning is generally useful (except for the
> funky case of ArrayDispatch stuff), or generally useless.
> >
> > Cheers,
> >
> > --
> > ____________________________________________________________
> > Sean McBride, B. Eng                 sean at rogue-research.com
> > Rogue Research                        www.rogue-research.com
> > Mac Software Developer              Montréal, Québec, Canada
> >
> >
> > _______________________________________________
> > 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
> >
> _______________________________________________
> 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
>
>


-- 
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170817/5506239d/attachment.html>


More information about the vtk-developers mailing list