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)
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: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
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/1181I have opened a pull request adapting the upstream fix: https://github.com/macports/macports-ports/pull/8395