This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 909 - Warning C4702: unreachable code
Summary: Warning C4702: unreachable code
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.2
Hardware: x86 - 32-bit Windows
: Normal Compilation Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-26 13:37 UTC by suryp2
Modified: 2019-12-04 13:55 UTC (History)
3 users (show)



Attachments

Description suryp2 2014-11-26 13:37:33 UTC
Macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW generates Warning C4702: unreachable code when building on VS2012 toolkit.

My understanding of this:
Part of that macro is another macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW_NOTHROW which is unfolded to:

void* operator new(size_t size, const std::nothrow_t&) throw()
{
try { return Eigen::internal::conditional_aligned_malloc<NeedsToAlign>(size); }
catch (...) { return 0; }
return 0;
}

The last return 0; seems to be the culprit. When I remove it, then VS2012 is happy and no warning appears.
Comment 1 Christoph Hertzberg 2014-11-26 15:50:44 UTC
Fixed here:
https://bitbucket.org/eigen/eigen/commits/e50ba6c6976

In the devel branch it had been fixed already:
https://bitbucket.org/eigen/eigen/commits/c071cfb18ff#LEigen/src/Core/util/Memory.hF713T689
Comment 2 Nobody 2019-12-04 13:55:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/909.

Note You need to log in before you can comment on or make changes to this bug.