[cfe-dev] -Wmismatched-tags in MacOSX's valarray

Lang Hames lhames at gmail.com
Thu Oct 21 05:55:59 PDT 2010


> I agree! :-) It would be nice to have an option for it, like -wsystem.
>

One of my colleagues pointed this issue out to me a while back too. I took a
quick look but wasn't able to figure out why the warning isn't being
suppressed (I'm not particularly familiar with clang). I opened
http://llvm.org/bugs/show_bug.cgi?id=8129 to track the issue.

Cheers,
Lang.


> Cheers, Axel.
>
> >
> > On 21 Oct 2010, at 10:09, Axel Naumann wrote:
> >
> >> Hi,
> >>
> >> compiling code that #includes <valarray> on MacOS X 10.6 triggers this:
> >>
> >> warning: class  '_Array' was previously declared as a struct
> >> [-Wmismatched-tags]
> >> In file included from cint/cint/lib/dll_stl/G__cpp_valarray.cxx:7:
> >> In file included from ./cint/cint/lib/dll_stl/G__cpp_valarray.h:32:
> >> In file included from ./cint/cint/lib/dll_stl/vary.h:10:
> >> In file included from /usr/include/c++/4.2.1/valarray:539:
> >> /usr/include/c++/4.2.1/bits/valarray_after.h:62:24: note: in
> >> instantiation of template class 'std::valarray<unsigned long>' requested
> >> here
> >>      { return _M_index.size(); }
> >>                       ^
> >> In file included from cint/cint/lib/dll_stl/G__cpp_valarray.cxx:7:
> >> In file included from ./cint/cint/lib/dll_stl/G__cpp_valarray.h:32:
> >> In file included from ./cint/cint/lib/dll_stl/vary.h:10:
> >> In file included from /usr/include/c++/4.2.1/valarray:91:
> >> /usr/include/c++/4.2.1/bits/valarray_array.h:414:12: note: previous use
> >> is here
> >>    struct _Array
> >>           ^
> >> Is this warning correct? If so: can you get your colleagues down the
> >> hallway to fix it? ;-)
> >
> > The problem is that 'struct _Array' is used in valarray_array.h, while
> >>
> >> And probably it's just me, but I have a hard time understanding the
> >> warning message itself: is it claiming that structs cannot be templated?
> >> Where is the "class _Array" that mismatches the "struct _Array"?
> >>
> >> Cheers, Axel.
> >> _______________________________________________
> >> cfe-dev mailing list
> >> cfe-dev at cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> >
> >
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101021/b0006c35/attachment.html>


More information about the cfe-dev mailing list