New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
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: 2015-10-09 08:18 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???

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