This bugzilla service is closed. All entries have been migrated to
Bug 1079 - Bad practice w/errno causes compilation issue
Summary: Bad practice w/errno causes compilation issue
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.2
Hardware: All Windows
: Normal Compilation Problem
Assignee: Nobody
Depends on:
Reported: 2015-10-08 19:20 UTC by Stephen Dunn
Modified: 2019-12-04 15:00 UTC (History)
3 users (show)


Description Stephen Dunn 2015-10-08 19:20:32 UTC
Best-practice guidelines for Windows Socket Servers (according to the MSDN) is to use the following:

#define errno WSAGetLastError()

For direct-mapping to Unix-style socket errors for compatibility in IPv4 servers. However, this conflicts with line 167 in Memory.h:

 166:   #ifdef EIGEN_HAS_ERRNO
 167:   errno = ENOMEM; // according to the standard
 168:   #endif

Which results in a compile error. It is not safe to assume errno is a primitive value type.
Comment 1 Gael Guennebaud 2015-10-09 08:18:30 UTC
hm, this contradicts the C++ standard:

I'm also a bit confuse, do you mean that you defined "#define errno WSAGetLastError()" in your own code and that WSAGetLastError() does not return a writable reference, or that is how errno is defined by <cerrno>, or that errno is not defined at all???
Comment 2 Nobody 2019-12-04 15:00:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to'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:

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