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

Axel Naumann Axel.Naumann at cern.ch
Thu Oct 21 02:09:28 PDT 2010


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? ;-)

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.



More information about the cfe-dev mailing list