[Insight-developers] failing ITK tests when using clang, reduced test case, need C++ expert

David Cole david.cole at kitware.com
Mon Dec 5 15:29:19 EST 2011


Sean,

Why does our dashmacmini5 build using clang only have 5 failing tests?

http://cdash.org/CDash/buildSummary.php?buildid=1790208


On Mon, Dec 5, 2011 at 2:55 PM, Sean McBride <sean at rogue-research.com> wrote:
> Hi all,
>
> After many man-hours, my coworker Alex and I have found why so many ITK tests fail when built with clang.
>
> It's the ITK_NO_RETURN #define.  If it's defined to nothing, *all* tests pass with clang, it it's defined to __attribute__ ( ( noreturn ) ), then we have the problem of hundreds of crashing tests.
>
> Any C++ language lawyers out there able to comment on whether this use of 'noreturn' is kosher?  :)  I dunno if this is an ITK or clang problem.  You may recognize the lineage of this snippit, as it is a reduction of an ITK test that started life with an itkImage and itkMultiThreader.
>
> The bug entry (with the llvm folks) is here:
> <http://llvm.org/bugs/show_bug.cgi?id=9395>
>
> The snippit is:
>
> ----------------
> #include <cassert>
>
> // when defined, clang generates code that segfaults, gcc does not
> #define NORETURN __attribute__ ( ( noreturn ) )
>
> class A
> {
> protected:
>  static void ThreaderCallback(void *arg) {
>    A *str = (A *)arg;
>    str->ThreadedGenerateData();
>  }
>    virtual void ThreadedGenerateData(void) NORETURN  {
>    assert(0);
>  }
> };
>
> class B : public A
> {
> protected:
>  void ThreadedGenerateData() {
>  }
>
> public:
>  void run () {
>    A::ThreaderCallback(this);
>  }
> };
>
>
> int main()
> {
>  B myb;
>  myb.run();
>
>  return 0;
> }
> ----------------
>
> Thanks!
>
> --
> ____________________________________________________________
> 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
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers


More information about the Insight-developers mailing list