Opened 4 years ago

Closed 4 years ago

#60771 closed defect (fixed)

zmq22: error: non-constant-expression cannot be narrowed from type 'long' to '__darwin_suseconds_t' (aka 'int') in initializer list

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: michaelld (Michael Dickens), chrstphrchvz (Christopher Chavez)
Port: zmq22

Description

zmq22 does not build with newer compilers:

select.cpp:162:13: error: non-constant-expression cannot be narrowed from type 'long' to '__darwin_suseconds_t' (aka 'int') in initializer list [-Wc++11-narrowing]
            (long) (timeout % 1000 * 1000)};
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select.cpp:162:13: note: insert an explicit cast to silence this issue
            (long) (timeout % 1000 * 1000)};
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            static_cast<__darwin_suseconds_t>( )
1 error generated.

Newer compilers default to C++11 mode. If this code can be made compatible with C++11 mode without requiring it, great. If not, you can specify an earlier mode with:

configure.cxxflags-append -std=c++98

Change History (3)

comment:1 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

This also affects zmq3, however I did not manage to personally reproduce this issue for either port. This issue was addressed upstream: https://github.com/zeromq/libzmq/pull/1181

I have opened a pull request adapting the upstream fix: https://github.com/macports/macports-ports/pull/8395

comment:2 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:3 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Resolution: fixed
Status: assignedclosed

In 5399f6fa25d70ae9e15ec0e9462fab576f441b2c/macports-ports (master):

zmq22, zmq3: fix build

Fixes: #60771

Note: See TracTickets for help on using tickets.