This bugzilla service is closed. All entries have been migrated to

Bug 1079

Summary: Bad practice w/errno causes compilation issue
Product: Eigen Reporter: Stephen Dunn <dunn.stephen>
Component: Core - generalAssignee: Nobody <eigen.nobody>
Status: NEW ---    
Severity: Compilation Problem CC: chtz, gael.guennebaud, jacob.benoit.1
Priority: Normal    
Version: 3.2   
Hardware: All   
OS: Windows   

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: