Re: [eigen] Eigen::Ref and GCC's -Wzero-as-null-pointer-constant |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
On 2016-03-04 09:00, Marc Glisse wrote:
NULL should not be used in C++. In C++11, there is nullptr, but Eigen
still supports C++03. In the warnings you mention, some code could be
changed (ptr == 0 --> !ptr), but some would be much uglier (initializing
something to 0, returning 0).
We could define a macro EIGEN_NULLPTR to be nullptr or 0, depending on
the used standard and use that everywhere. I'm not aware of any C++03
compatible way to suppress this warning. E.g., the following definition
of a C++03-nullptr would generate the warning itself:
https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/nullptr#Solution_and_Sample_Code
The usual trick when you want to see warnings in your code but not in a
library you are using is to specify the path to that library with
-isystem instead of -I. This inhibits most warnings for files in that path.
Yes, that's the common workaround -- or we could disable this warning
inside Eigen. But we generally try to generate no warnings inside Eigen
(at least for somewhat reasonable warnings).
Christoph
--
Dipl. Inf., Dipl. Math. Christoph Hertzberg
Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 1
28359 Bremen, Germany
Zentrale: +49 421 178 45-6611
Besuchsadresse der Nebengeschäftsstelle:
Robert-Hooke-Straße 5
28359 Bremen, Germany
Tel.: +49 421 178 45-4021
Empfang: +49 421 178 45-6600
Fax: +49 421 178 45-4150
E-Mail: chtz@xxxxxxxxxxxxxxxxxxxxxxxx
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik