|[eigen] Dynamic exception specifications are deprecated in C++11 mode and other warnings|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: "eigen@xxxxxxxxxxxxxxxxxxx" <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] Dynamic exception specifications are deprecated in C++11 mode and other warnings
- From: Nicola Gigante <nicola.gigante@xxxxxxxxx>
- Date: Sat, 23 Aug 2014 11:58:43 +0200
- Cc: Nicola Gigante <nicola.gigante@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; bh=IZ38hmRjU323nxi7Lckf8QyER3ndtmNWJ+kzgBk4ddE=; b=QMt36chUREXlyymceSaNhDk/IeFzthRqoEDMwMqqyEpyq1SDQ9REOUUSk8uBQYsnKO 5usLFZtKEiEXR7uVDRfejFiAs1kIgxXLSTTcleR5timKKdB7L3EUuPJOLEk512Evdpaq ET2krDVGFKYStgRtnv3cw9Nig0NLyaivKFz7SDZX6MOsctiXA3FaSGnVyve4Fa5wHZSf WRaGVoECwgQI2Am5oDYwOoXsjHr4MjQo/DUPeSvBynCEEvKPqMi3a1gPvAu/jtWf85wD KUGHiNhMC8jCXnOPPAo2owVDQI/ebtJv+QjeroMtChxL1cTaG71zkLSF9Uv2halqDkzz tX+A==
I've imported Eigen 3.2.2 in a project where the policy is to have everything compile
without warning with the clang flag -Weverything, and I ran in a couple of issues
with Eigen headers.
We're compiling in C++11 mode.
The first is that -Wdocumentation and Wdocumentation-unkown-command trigger
basically everywhere, complaining about a lot of unknown commands or missing
I'm not an expert of Doxygen, and I don't know if clang is correct or not, but it would
be nice if someone that knows how Eigen doc is structured to have a look, so I would
know if I have to file a bug to clang. This is not a big problem however, we can live
The second triggers on the throw_std_bad_alloc() function in Memory.h.
The compiler triggers -Wmissing-noreturn, which suggests that the function
could be declared with the [[noreturn]] attribute, because it only throws an
exception (when exceptions are enabled, of course).
I would like to add the attribute to the function.
Note that [[noreturn]] is a C++11 attribute syntax, but on clang and g++
(and ICC, I suppose) it is the same as __attribute__((noreturn)) which is supported
and could be useful also in C++98 mode.
Do you have a feature test macro in eigen for the support of the noreturn attribute?
If not, do you have a feature test macro for GNU-like compilers?
The third issue trigger on the
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF and similar macros.
They declare operators with the throw() dynamic exception specification, which
is deprecated in C++11 and with much probability will become ill-formed in C++17.
Even in C++98 it's not a brilliant idea anyway, for performance reasons.
I would like to add a macro such as EIGEN_NOTHROW that would expand
to throw() or noexcept() depending on the language version (that's how a lot
of other libraries deal with the issue).
How do you test for C++11 mode in eigen sources? Is there a feature test macro,
or should I simply use __cplusplus?
Globally, would you accept patches for those issues?