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

MacPorts noreply at macports.org
Fri Jul 3 11:59:27 UTC 2020


#60771: zmq22: error: non-constant-expression cannot be narrowed from type 'long'
to '__darwin_suseconds_t' (aka 'int') in initializer list
------------------------+----------------------
 Reporter:  ryandesign  |      Owner:  stromnov
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:  2.6.2
 Keywords:              |       Port:  zmq22
------------------------+----------------------
 [https://build.macports.org/builders/ports-10.6_x86_64-builder/builds/29257/steps
 /install-port/logs/stdio 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
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/60771>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list