This forum has been archived. All content is frozen. Please use KDE Discuss instead.

mingw g++ -std=c++11 gives warning

Tags: None
(comma "," separated)
balabi
Registered Member
Posts
2
Karma
0

mingw g++ -std=c++11 gives warning

Mon Jan 11, 2016 1:40 am
When I compile Eigen with mingw g++, it gives warnings like
Code: Select all
D:\w\WORK\C++program\use eigen>g++ -std=c++11 -I c:\e firsteigen.cpp
In file included from c:\e/Eigen/Core:276:0,
                 from c:\e/Eigen/Dense:1,
                 from firsteigen.cpp:1:
c:\e/Eigen/src/Core/Functors.h:973:28: warning: 'template<class _Operation> clas
s std::binder2nd' is deprecated [-Wdeprecated-declarations]
 struct functor_traits<std::binder2nd<T> >
                            ^
In file included from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/bits/s
tl_function.h:1128:0,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/string
:48,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/bits/l
ocale_classes.h:40,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/bits/i
os_base.h:41,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/ios:42
,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/istrea
m:38,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/sstrea
m:38,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/comple
x:45,
                 from c:\e/Eigen/Core:28,
                 from c:\e/Eigen/Dense:1,
                 from firsteigen.cpp:1:
c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/backward/binders.h:143:11: n
ote: declared here
     class binder2nd
           ^
In file included from c:\e/Eigen/Core:276:0,
                 from c:\e/Eigen/Dense:1,
                 from firsteigen.cpp:1:
c:\e/Eigen/src/Core/Functors.h:977:28: warning: 'template<class _Operation> clas
s std::binder1st' is deprecated [-Wdeprecated-declarations]
 struct functor_traits<std::binder1st<T> >
                            ^
In file included from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/bits/s
tl_function.h:1128:0,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/string
:48,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/bits/l
ocale_classes.h:40,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/bits/i
os_base.h:41,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/ios:42
,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/istrea
m:38,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/sstrea
m:38,
                 from c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/comple
x:45,
                 from c:\e/Eigen/Core:28,
                 from c:\e/Eigen/Dense:1,
                 from firsteigen.cpp:1:
c:/mingw-w64/mingw64/x86_64-w64-mingw32/include/c++/backward/binders.h:108:11: n
ote: declared here
     class binder1st
           ^


Why? If I use intel icl, there is no warnings
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
The warning message is self-explanatory. The usage of the deprecated binder* classes has been removed in 3.3-beta1.
User avatar
VictorL
Registered Member
Posts
14
Karma
0
OS
I get a lot of warnings too even though I'm using 3.3 beta 2

Code: Select all
eigen-eigen-69d418c06999/

 CXX_VERSION:       c++ (Ubuntu 6.2.0-3ubuntu11~14.04) 6.2.0 20160901
 CXX_FLAGS:         -fdiagnostics-color   -pedantic -Wall -Wextra -Wundef -Wcast-align -Wchar-subscripts -Wnon-virtual-dtor -Wunused-local-typedefs -Wpointer-arith -Wwrite-strings -Wformat-security -Wlogical-op -Wdouble-promotion -Wno-psabi -Wno-variadic-macros -Wno-long-long -fno-check-new -fno-common -fstrict-aliasing -ansi
 Sparse lib flags:   

-- ************************************************************
--
-- Configured Eigen 3.2.93
(version does not seem up to date)

Example warnings:
Code: Select all
/usr/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h:29:39: warning: ignoring attributes on template argument '__m128 {aka __vector(4) float}' [-Wignored-attributes]
 template<> struct is_arithmetic<__m128>  { enum { value = true }; };
                                       ^

Code: Select all
/usr/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h:101:43: warning: ignoring attributes on template argument 'Eigen::internal::Packet4f {aka __vector(4) float}' [-Wignored-attributes]
 template<> struct unpacket_traits<Packet4f> { typedef float  type; enum {size=4}; };

Code: Select all
/usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h: In instantiation of 'class Eigen::DenseCoeffsBase<Eigen::Matrix<float, 4, 1>, 0>':
/usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:274:7:   required from 'class Eigen::DenseCoeffsBase<Eigen::Matrix<float, 4, 1>, 1>'
/usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:636:7:   required from 'class Eigen::DenseCoeffsBase<Eigen::Matrix<float, 4, 1>, 3>'
/usr/include/eigen3/Eigen/src/Core/util/XprHelper.h:371:8:   required from 'struct Eigen::internal::special_scalar_op_base<Eigen::Matrix<float, 4, 1>, float, float, false>'
/usr/include/eigen3/Eigen/src/Core/DenseBase.h:41:34:   required from 'class Eigen::DenseBase<Eigen::Matrix<float, 4, 1> >'
/usr/include/eigen3/Eigen/src/Core/MatrixBase.h:48:34:   required from 'class Eigen::MatrixBase<Eigen::Matrix<float, 4, 1> >'
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:88:7:   required from 'class Eigen::PlainObjectBase<Eigen::Matrix<float, 4, 1> >'
/usr/include/eigen3/Eigen/src/Core/Matrix.h:127:7:   required from 'class Eigen::Matrix<float, 4, 1>'
/usr/include/eigen3/Eigen/src/Geometry/Quaternion.h:282:16:   required from 'class Eigen::Quaternion<float>'
/usr/include/eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h:22:3:   required from here
/usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:56:30: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits<float>::type {aka __vector(4) float}' [-Wignored-attributes]
                      >::type PacketReturnType;
                              ^~~~~~~~~~~~~~~~


Am I using the right Eigen version?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
hm, this warning is disabled there: https://bitbucket.org/eigen/eigen/src/f ... nings.h-45

Do you see it when compiling Eigen's unit tests? or only when compiling your project?
User avatar
VictorL
Registered Member
Posts
14
Karma
0
OS
Even though my CMake project tells me it finds/uses the installed version:
Code: Select all
-- Checking for module 'eigen3'
--   Found eigen3, version 3.2.93
-- Found Eigen: /usr/local/include/eigen3 
-- Eigen found (include: /usr/local/include/eigen3)


The compilation warnings are against the release version in /usr/include ... so the problem is on my side, I have tested projects compiled with the last beta of Eigen and I don't have the warnings.

Sorry for the trouble!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]